kanna-code 0.15.0 → 0.16.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/README.md +10 -0
- package/dist/client/assets/index-BET6YVYr.css +32 -0
- package/dist/client/assets/index-DMxCijCf.js +533 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/src/server/agent.ts +4 -2
- package/src/server/cli-runtime.ts +5 -1
- package/src/server/codex-app-server-protocol.ts +8 -1
- package/src/server/codex-app-server.ts +1 -1
- package/src/server/event-store.test.ts +112 -1
- package/src/server/event-store.ts +170 -26
- package/src/server/events.ts +1 -3
- package/src/server/provider-catalog.test.ts +29 -1
- package/src/server/provider-catalog.ts +8 -1
- package/src/server/read-models.test.ts +1 -1
- package/src/server/read-models.ts +3 -3
- package/src/server/server.ts +2 -0
- package/src/server/ws-router.ts +1 -1
- package/src/shared/types.ts +40 -2
- package/dist/client/assets/index-C6R1P_HL.js +0 -523
- package/dist/client/assets/index-CA-kJR8F.css +0 -32
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
var YO=Object.defineProperty;var Mw=e=>{throw TypeError(e)};var XO=(e,t,n)=>t in e?YO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var on=(e,t,n)=>XO(e,typeof t!="symbol"?t+"":t,n),Nw=(e,t,n)=>t.has(e)||Mw("Cannot "+n);var Ic=(e,t,n)=>(Nw(e,t,"read from private field"),n?n.call(e):t.get(e)),Aw=(e,t,n)=>t.has(e)?Mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Dw=(e,t,n,r)=>(Nw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function ZO(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 l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{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 l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Jf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zg={exports:{}},Hc={};/**
|
|
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 Ow;function QO(){if(Ow)return Hc;Ow=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var a=null;if(l!==void 0&&(a=""+l),s.key!==void 0&&(a=""+s.key),"key"in s){l={};for(var u in s)u!=="key"&&(l[u]=s[u])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:l}}return Hc.Fragment=t,Hc.jsx=n,Hc.jsxs=n,Hc}var Lw;function JO(){return Lw||(Lw=1,Zg.exports=QO()),Zg.exports}var g=JO(),Qg={exports:{}},Fe={};/**
|
|
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 jw;function e4(){if(jw)return Fe;jw=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"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function y(z){return z===null||typeof z!="object"?null:(z=_&&z[_]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(z,Y,A){this.props=z,this.context=Y,this.refs=C,this.updater=A||S}k.prototype.isReactComponent={},k.prototype.setState=function(z,Y){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Y,"setState")},k.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(z,Y,A){this.props=z,this.context=Y,this.refs=C,this.updater=A||S}var M=R.prototype=new T;M.constructor=R,w(M,k.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function D(){}var j={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(z,Y,A){var oe=A.ref;return{$$typeof:e,type:z,key:Y,ref:oe!==void 0?oe:null,props:A}}function P(z,Y){return G(z.type,Y,z.props)}function W(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function I(z){var Y={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(A){return Y[A]})}var $=/\/+/g;function U(z,Y){return typeof z=="object"&&z!==null&&z.key!=null?I(""+z.key):Y.toString(36)}function H(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(D,D):(z.status="pending",z.then(function(Y){z.status==="pending"&&(z.status="fulfilled",z.value=Y)},function(Y){z.status==="pending"&&(z.status="rejected",z.reason=Y)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,Y,A,oe,fe){var se=typeof z;(se==="undefined"||se==="boolean")&&(z=null);var J=!1;if(z===null)J=!0;else switch(se){case"bigint":case"string":case"number":J=!0;break;case"object":switch(z.$$typeof){case e:case t:J=!0;break;case p:return J=z._init,B(J(z._payload),Y,A,oe,fe)}}if(J)return fe=fe(z),J=oe===""?"."+U(z,0):oe,O(fe)?(A="",J!=null&&(A=J.replace($,"$&/")+"/"),B(fe,Y,A,"",function(ce){return ce})):fe!=null&&(W(fe)&&(fe=P(fe,A+(fe.key==null||z&&z.key===fe.key?"":(""+fe.key).replace($,"$&/")+"/")+J)),Y.push(fe)),1;J=0;var ge=oe===""?".":oe+":";if(O(z))for(var ie=0;ie<z.length;ie++)oe=z[ie],se=ge+U(oe,ie),J+=B(oe,Y,A,se,fe);else if(ie=y(z),typeof ie=="function")for(z=ie.call(z),ie=0;!(oe=z.next()).done;)oe=oe.value,se=ge+U(oe,ie++),J+=B(oe,Y,A,se,fe);else if(se==="object"){if(typeof z.then=="function")return B(H(z),Y,A,oe,fe);throw Y=String(z),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return J}function q(z,Y,A){if(z==null)return z;var oe=[],fe=0;return B(z,oe,"","",function(se){return Y.call(A,se,fe++)}),oe}function V(z){if(z._status===-1){var Y=z._result;Y=Y(),Y.then(function(A){(z._status===0||z._status===-1)&&(z._status=1,z._result=A)},function(A){(z._status===0||z._status===-1)&&(z._status=2,z._result=A)}),z._status===-1&&(z._status=0,z._result=Y)}if(z._status===1)return z._result.default;throw z._result}var Z=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},N={map:q,forEach:function(z,Y,A){q(z,function(){Y.apply(this,arguments)},A)},count:function(z){var Y=0;return q(z,function(){Y++}),Y},toArray:function(z){return q(z,function(Y){return Y})||[]},only:function(z){if(!W(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Fe.Activity=m,Fe.Children=N,Fe.Component=k,Fe.Fragment=n,Fe.Profiler=s,Fe.PureComponent=R,Fe.StrictMode=r,Fe.Suspense=h,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return j.H.useMemoCache(z)}},Fe.cache=function(z){return function(){return z.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(z,Y,A){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var oe=w({},z.props),fe=z.key;if(Y!=null)for(se in Y.key!==void 0&&(fe=""+Y.key),Y)!F.call(Y,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&Y.ref===void 0||(oe[se]=Y[se]);var se=arguments.length-2;if(se===1)oe.children=A;else if(1<se){for(var J=Array(se),ge=0;ge<se;ge++)J[ge]=arguments[ge+2];oe.children=J}return G(z.type,fe,oe)},Fe.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Fe.createElement=function(z,Y,A){var oe,fe={},se=null;if(Y!=null)for(oe in Y.key!==void 0&&(se=""+Y.key),Y)F.call(Y,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(fe[oe]=Y[oe]);var J=arguments.length-2;if(J===1)fe.children=A;else if(1<J){for(var ge=Array(J),ie=0;ie<J;ie++)ge[ie]=arguments[ie+2];fe.children=ge}if(z&&z.defaultProps)for(oe in J=z.defaultProps,J)fe[oe]===void 0&&(fe[oe]=J[oe]);return G(z,se,fe)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(z){return{$$typeof:u,render:z}},Fe.isValidElement=W,Fe.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:V}},Fe.memo=function(z,Y){return{$$typeof:d,type:z,compare:Y===void 0?null:Y}},Fe.startTransition=function(z){var Y=j.T,A={};j.T=A;try{var oe=z(),fe=j.S;fe!==null&&fe(A,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,Z)}catch(se){Z(se)}finally{Y!==null&&A.types!==null&&(Y.types=A.types),j.T=Y}},Fe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Fe.use=function(z){return j.H.use(z)},Fe.useActionState=function(z,Y,A){return j.H.useActionState(z,Y,A)},Fe.useCallback=function(z,Y){return j.H.useCallback(z,Y)},Fe.useContext=function(z){return j.H.useContext(z)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(z,Y){return j.H.useDeferredValue(z,Y)},Fe.useEffect=function(z,Y){return j.H.useEffect(z,Y)},Fe.useEffectEvent=function(z){return j.H.useEffectEvent(z)},Fe.useId=function(){return j.H.useId()},Fe.useImperativeHandle=function(z,Y,A){return j.H.useImperativeHandle(z,Y,A)},Fe.useInsertionEffect=function(z,Y){return j.H.useInsertionEffect(z,Y)},Fe.useLayoutEffect=function(z,Y){return j.H.useLayoutEffect(z,Y)},Fe.useMemo=function(z,Y){return j.H.useMemo(z,Y)},Fe.useOptimistic=function(z,Y){return j.H.useOptimistic(z,Y)},Fe.useReducer=function(z,Y,A){return j.H.useReducer(z,Y,A)},Fe.useRef=function(z){return j.H.useRef(z)},Fe.useState=function(z){return j.H.useState(z)},Fe.useSyncExternalStore=function(z,Y,A){return j.H.useSyncExternalStore(z,Y,A)},Fe.useTransition=function(){return j.H.useTransition()},Fe.version="19.2.1",Fe}var zw;function Yy(){return zw||(zw=1,Qg.exports=e4()),Qg.exports}var b=Yy();const Et=Jf(b),PE=ZO({__proto__:null,default:Et},[b]);var Jg={exports:{}},Fc={},ev={exports:{}},tv={};/**
|
|
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 Pw;function t4(){return Pw||(Pw=1,(function(e){function t(B,q){var V=B.length;B.push(q);e:for(;0<V;){var Z=V-1>>>1,N=B[Z];if(0<s(N,q))B[Z]=q,B[V]=N,V=Z;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var q=B[0],V=B.pop();if(V!==q){B[0]=V;e:for(var Z=0,N=B.length,z=N>>>1;Z<z;){var Y=2*(Z+1)-1,A=B[Y],oe=Y+1,fe=B[oe];if(0>s(A,V))oe<N&&0>s(fe,A)?(B[Z]=fe,B[oe]=V,Z=oe):(B[Z]=A,B[Y]=V,Z=Y);else if(oe<N&&0>s(fe,V))B[Z]=fe,B[oe]=V,Z=oe;else break e}}return q}function s(B,q){var V=B.sortIndex-q.sortIndex;return V!==0?V:B.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var h=[],d=[],p=1,m=null,_=3,y=!1,S=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(B){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=B)r(d),q.sortIndex=q.expirationTime,t(h,q);else break;q=n(d)}}function O(B){if(w=!1,M(B),!S)if(n(h)!==null)S=!0,D||(D=!0,I());else{var q=n(d);q!==null&&H(O,q.startTime-B)}}var D=!1,j=-1,F=5,G=-1;function P(){return C?!0:!(e.unstable_now()-G<F)}function W(){if(C=!1,D){var B=e.unstable_now();G=B;var q=!0;try{e:{S=!1,w&&(w=!1,T(j),j=-1),y=!0;var V=_;try{t:{for(M(B),m=n(h);m!==null&&!(m.expirationTime>B&&P());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,_=m.priorityLevel;var N=Z(m.expirationTime<=B);if(B=e.unstable_now(),typeof N=="function"){m.callback=N,M(B),q=!0;break t}m===n(h)&&r(h),M(B)}else r(h);m=n(h)}if(m!==null)q=!0;else{var z=n(d);z!==null&&H(O,z.startTime-B),q=!1}}break e}finally{m=null,_=V,y=!1}q=void 0}}finally{q?I():D=!1}}}var I;if(typeof R=="function")I=function(){R(W)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,U=$.port2;$.port1.onmessage=W,I=function(){U.postMessage(null)}}else I=function(){k(W,0)};function H(B,q){j=k(function(){B(e.unstable_now())},q)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(B){switch(_){case 1:case 2:case 3:var q=3;break;default:q=_}var V=_;_=q;try{return B()}finally{_=V}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var V=_;_=B;try{return q()}finally{_=V}},e.unstable_scheduleCallback=function(B,q,V){var Z=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Z+V:Z):V=Z,B){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=V+N,B={id:p++,callback:q,priorityLevel:B,startTime:V,expirationTime:N,sortIndex:-1},V>Z?(B.sortIndex=V,t(d,B),n(h)===null&&B===n(d)&&(w?(T(j),j=-1):w=!0,H(O,V-Z))):(B.sortIndex=N,t(h,B),S||y||(S=!0,D||(D=!0,I()))),B},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(B){var q=_;return function(){var V=_;_=q;try{return B.apply(this,arguments)}finally{_=V}}}})(tv)),tv}var Bw;function n4(){return Bw||(Bw=1,ev.exports=t4()),ev.exports}var nv={exports:{}},On={};/**
|
|
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 Iw;function r4(){if(Iw)return On;Iw=1;var e=Yy();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}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 l(h,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:p}}var a=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 On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,On.createPortal=function(h,d){var p=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 l(h,d,null,p)},On.flushSync=function(h){var d=a.T,p=r.p;try{if(a.T=null,r.p=2,h)return h()}finally{a.T=d,r.p=p,r.d.f()}},On.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))},On.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},On.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:y}):p==="script"&&r.d.X(h,{crossOrigin:m,integrity:_,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},On.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:p,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)},On.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);r.d.L(h,p,{crossOrigin:m,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})}},On.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},On.requestFormReset=function(h){r.d.r(h)},On.unstable_batchedUpdates=function(h,d){return h(d)},On.useFormState=function(h,d,p){return a.H.useFormState(h,d,p)},On.useFormStatus=function(){return a.H.useHostTransitionStatus()},On.version="19.2.1",On}var Hw;function BE(){if(Hw)return nv.exports;Hw=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(),nv.exports=r4(),nv.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 Fw;function i4(){if(Fw)return Fc;Fw=1;var e=n4(),t=Yy(),n=BE();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" 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 l(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function a(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function h(i){if(l(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=l(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var v=c.return;if(v===null)break;var x=v.alternate;if(x===null){if(f=v.return,f!==null){c=f;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===c)return h(v),i;if(x===f)return h(v),o;x=x.sibling}throw Error(r(188))}if(c.return!==f.return)c=v,f=x;else{for(var E=!1,L=v.child;L;){if(L===c){E=!0,c=v,f=x;break}if(L===f){E=!0,f=v,c=x;break}L=L.sibling}if(!E){for(L=x.child;L;){if(L===c){E=!0,c=x,f=v;break}if(L===f){E=!0,f=x,c=v;break}L=L.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function I(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var $=Symbol.for("react.client.reference");function U(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===$?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case R:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case M:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return o=i.displayName||null,o!==null?o:U(i.type)||"Memo";case F:o=i._payload,i=i._init;try{return U(i(o))}catch{}}return null}var H=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},Z=[],N=-1;function z(i){return{current:i}}function Y(i){0>N||(i.current=Z[N],Z[N]=null,N--)}function A(i,o){N++,Z[N]=i.current,i.current=o}var oe=z(null),fe=z(null),se=z(null),J=z(null);function ge(i,o){switch(A(se,o),A(fe,i),A(oe,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?QS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=QS(o),i=JS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(oe),A(oe,i)}function ie(){Y(oe),Y(fe),Y(se)}function ce(i){i.memoizedState!==null&&A(J,i);var o=oe.current,c=JS(o,i.type);o!==c&&(A(fe,i),A(oe,c))}function we(i){fe.current===i&&(Y(oe),Y(fe)),J.current===i&&(Y(J),jc._currentValue=V)}var Se,ke;function Be(i){if(Se===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Se=o&&o[1]||"",ke=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Se+i+ke}var Ce=!1;function Oe(i,o){if(!i||Ce)return"";Ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ae){var ne=ae}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(ae){ne=ae}i.call(pe.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),E=x[0],L=x[1];if(E&&L){var K=E.split(`
|
|
44
|
+
`),te=L.split(`
|
|
45
|
+
`);for(v=f=0;f<K.length&&!K[f].includes("DetermineComponentFrameRoot");)f++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(f===K.length||v===te.length)for(f=K.length-1,v=te.length-1;1<=f&&0<=v&&K[f]!==te[v];)v--;for(;1<=f&&0<=v;f--,v--)if(K[f]!==te[v]){if(f!==1||v!==1)do if(f--,v--,0>v||K[f]!==te[v]){var de=`
|
|
46
|
+
`+K[f].replace(" at new "," at ");return i.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",i.displayName)),de}while(1<=f&&0<=v);break}}}finally{Ce=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Be(c):""}function bt(i,o){switch(i.tag){case 26:case 27:case 5:return Be(i.type);case 16:return Be("Lazy");case 13:return i.child!==o&&o!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Oe(i.type,!1);case 11:return Oe(i.type.render,!1);case 1:return Oe(i.type,!0);case 31:return Be("Activity");default:return""}}function hn(i){try{var o="",c=null;do o+=bt(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
+
Error generating stack: `+f.message+`
|
|
48
|
+
`+f.stack}}var xt=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,In=e.unstable_cancelCallback,cr=e.unstable_shouldYield,Gr=e.unstable_requestPaint,le=e.unstable_now,Rt=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ie=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Ct=e.log,Yn=e.unstable_setDisableYieldValue,nn=null,Pt=null;function Gt(i){if(typeof Ct=="function"&&Yn(i),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(nn,i)}catch{}}var ot=Math.clz32?Math.clz32:Ya,Xn=Math.log,Dn=Math.LN2;function Ya(i){return i>>>=0,i===0?32:31-(Xn(i)/Dn|0)|0}var bs=256,Li=262144,At=4194304;function Dt(i){var o=i&42;if(o!==0)return o;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 re(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var v=0,x=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var L=f&134217727;return L!==0?(f=L&~x,f!==0?v=Dt(f):(E&=L,E!==0?v=Dt(E):c||(c=L&~i,c!==0&&(v=Dt(c))))):(L=f&~x,L!==0?v=Dt(L):E!==0?v=Dt(E):c||(c=f&~i,c!==0&&(v=Dt(c)))),v===0?0:o!==0&&o!==v&&(o&x)===0&&(x=v&-v,c=o&-o,x>=c||x===32&&(c&4194048)!==0)?o:v}function _e(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ue(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Ye(){var i=At;return At<<=1,(At&62914560)===0&&(At=4194304),i}function lt(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function ur(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function rn(i,o,c,f,v,x){var E=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 L=i.entanglements,K=i.expirationTimes,te=i.hiddenUpdates;for(c=E&~c;0<c;){var de=31-ot(c),pe=1<<de;L[de]=0,K[de]=-1;var ne=te[de];if(ne!==null)for(te[de]=null,de=0;de<ne.length;de++){var ae=ne[de];ae!==null&&(ae.lane&=-536870913)}c&=~pe}f!==0&&Yr(i,f,0),x!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=x&~(E&~o))}function Yr(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-ot(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function dr(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-ot(c),v=1<<f;v&o|i[f]&o&&(i[f]|=o),c&=~v}}function Er(i,o){var c=o&-o;return c=(c&42)!==0?1:ji(c),(c&(i.suspendedLanes|o))!==0?0:c}function ji(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 zi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Xr(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:Sw(i.type))}function xs(i,o){var c=q.p;try{return q.p=i,o()}finally{q.p=c}}var Rr=Math.random().toString(36).slice(2),Cn="__reactFiber$"+Rr,Zn="__reactProps$"+Rr,gl="__reactContainer$"+Rr,Up="__reactEvents$"+Rr,BD="__reactListeners$"+Rr,ID="__reactHandles$"+Rr,I0="__reactResources$"+Rr,Xa="__reactMarker$"+Rr;function $p(i){delete i[Cn],delete i[Zn],delete i[Up],delete i[BD],delete i[ID]}function vl(i){var o=i[Cn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[gl]||c[Cn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=ow(i);i!==null;){if(c=i[Cn])return c;i=ow(i)}return o}i=c,c=i.parentNode}return null}function _l(i){if(i=i[Cn]||i[gl]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Za(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function yl(i){var o=i[I0];return o||(o=i[I0]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function fn(i){i[Xa]=!0}var H0=new Set,F0={};function bo(i,o){bl(i,o),bl(i+"Capture",o)}function bl(i,o){for(F0[i]=o,i=0;i<o.length;i++)H0.add(o[i])}var HD=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]*$"),U0={},$0={};function FD(i){return xt.call($0,i)?!0:xt.call(U0,i)?!1:HD.test(i)?$0[i]=!0:(U0[i]=!0,!1)}function cd(i,o,c){if(FD(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function ud(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Pi(i,o,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+f)}}function Tr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function W0(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function UD(i,o,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,x=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(E){c=""+E,x.call(this,E)}}),Object.defineProperty(i,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Wp(i){if(!i._valueTracker){var o=W0(i)?"checked":"value";i._valueTracker=UD(i,o,""+i[o])}}function V0(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=W0(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function dd(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 $D=/[\n"\\]/g;function Mr(i){return i.replace($D,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Vp(i,o,c,f,v,x,E,L){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),o!=null?E==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Tr(o)):i.value!==""+Tr(o)&&(i.value=""+Tr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?qp(i,E,Tr(o)):c!=null?qp(i,E,Tr(c)):f!=null&&i.removeAttribute("value"),v==null&&x!=null&&(i.defaultChecked=!!x),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?i.name=""+Tr(L):i.removeAttribute("name")}function q0(i,o,c,f,v,x,E,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),o!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||o!=null)){Wp(i);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(o):c,L||o===i.value||(i.value=o),i.defaultValue=o}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=L?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),Wp(i)}function qp(i,o,c){o==="number"&&dd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function xl(i,o,c,f){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&f&&(i[c].defaultSelected=!0)}else{for(c=""+Tr(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,f&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function K0(i,o,c){if(o!=null&&(o=""+Tr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Tr(c):""}function G0(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(H(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=Tr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),Wp(i)}function Sl(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var WD=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 Y0(i,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":f?i.setProperty(o,c):typeof c!="number"||c===0||WD.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function X0(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var v in o)f=o[v],o.hasOwnProperty(v)&&c[v]!==f&&Y0(i,v,f)}else for(var x in o)o.hasOwnProperty(x)&&Y0(i,x,o[x])}function Kp(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 VD=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"]]),qD=/^[\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 hd(i){return qD.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Bi(){}var Gp=null;function Yp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var wl=null,Cl=null;function Z0(i){var o=_l(i);if(o&&(i=o.stateNode)){var c=i[Zn]||null;e:switch(i=o.stateNode,o.type){case"input":if(Vp(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Mr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var v=f[Zn]||null;if(!v)throw Error(r(90));Vp(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&V0(f)}break e;case"textarea":K0(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&xl(i,!!c.multiple,o,!1)}}}var Xp=!1;function Q0(i,o,c){if(Xp)return i(o,c);Xp=!0;try{var f=i(o);return f}finally{if(Xp=!1,(wl!==null||Cl!==null)&&(Jd(),wl&&(o=wl,i=Cl,Cl=wl=null,Z0(o),i)))for(o=0;o<i.length;o++)Z0(i[o])}}function Qa(i,o){var c=i.stateNode;if(c===null)return null;var f=c[Zn]||null;if(f===null)return null;c=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var Ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zp=!1;if(Ii)try{var Ja={};Object.defineProperty(Ja,"passive",{get:function(){Zp=!0}}),window.addEventListener("test",Ja,Ja),window.removeEventListener("test",Ja,Ja)}catch{Zp=!1}var Ss=null,Qp=null,fd=null;function J0(){if(fd)return fd;var i,o=Qp,c=o.length,f,v="value"in Ss?Ss.value:Ss.textContent,x=v.length;for(i=0;i<c&&o[i]===v[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===v[x-f];f++);return fd=v.slice(i,1<f?1-f:void 0)}function pd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function md(){return!0}function ex(){return!1}function Qn(i){function o(c,f,v,x,E){this._reactName=c,this._targetInst=v,this.type=f,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(c=i[L],this[L]=c?c(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?md:ex,this.isPropagationStopped=ex,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=md)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){},isPersistent:md}),o}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gd=Qn(xo),ec=m({},xo,{view:0,detail:0}),KD=Qn(ec),Jp,em,tc,vd=m({},ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nm,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!==tc&&(tc&&i.type==="mousemove"?(Jp=i.screenX-tc.screenX,em=i.screenY-tc.screenY):em=Jp=0,tc=i),Jp)},movementY:function(i){return"movementY"in i?i.movementY:em}}),tx=Qn(vd),GD=m({},vd,{dataTransfer:0}),YD=Qn(GD),XD=m({},ec,{relatedTarget:0}),tm=Qn(XD),ZD=m({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),QD=Qn(ZD),JD=m({},xo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),e3=Qn(JD),t3=m({},xo,{data:0}),nx=Qn(t3),n3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},r3={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"},i3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function s3(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=i3[i])?!!o[i]:!1}function nm(){return s3}var o3=m({},ec,{key:function(i){if(i.key){var o=n3[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=pd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?r3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nm,charCode:function(i){return i.type==="keypress"?pd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?pd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),l3=Qn(o3),a3=m({},vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rx=Qn(a3),c3=m({},ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nm}),u3=Qn(c3),d3=m({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),h3=Qn(d3),f3=m({},vd,{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}),p3=Qn(f3),m3=m({},xo,{newState:0,oldState:0}),g3=Qn(m3),v3=[9,13,27,32],rm=Ii&&"CompositionEvent"in window,nc=null;Ii&&"documentMode"in document&&(nc=document.documentMode);var _3=Ii&&"TextEvent"in window&&!nc,ix=Ii&&(!rm||nc&&8<nc&&11>=nc),sx=" ",ox=!1;function lx(i,o){switch(i){case"keyup":return v3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ax(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var kl=!1;function y3(i,o){switch(i){case"compositionend":return ax(o);case"keypress":return o.which!==32?null:(ox=!0,sx);case"textInput":return i=o.data,i===sx&&ox?null:i;default:return null}}function b3(i,o){if(kl)return i==="compositionend"||!rm&&lx(i,o)?(i=J0(),fd=Qp=Ss=null,kl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ix&&o.locale!=="ko"?null:o.data;default:return null}}var x3={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 cx(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!x3[i.type]:o==="textarea"}function ux(i,o,c,f){wl?Cl?Cl.push(f):Cl=[f]:wl=f,o=oh(o,"onChange"),0<o.length&&(c=new gd("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var rc=null,ic=null;function S3(i){qS(i,0)}function _d(i){var o=Za(i);if(V0(o))return i}function dx(i,o){if(i==="change")return o}var hx=!1;if(Ii){var im;if(Ii){var sm="oninput"in document;if(!sm){var fx=document.createElement("div");fx.setAttribute("oninput","return;"),sm=typeof fx.oninput=="function"}im=sm}else im=!1;hx=im&&(!document.documentMode||9<document.documentMode)}function px(){rc&&(rc.detachEvent("onpropertychange",mx),ic=rc=null)}function mx(i){if(i.propertyName==="value"&&_d(ic)){var o=[];ux(o,ic,i,Yp(i)),Q0(S3,o)}}function w3(i,o,c){i==="focusin"?(px(),rc=o,ic=c,rc.attachEvent("onpropertychange",mx)):i==="focusout"&&px()}function C3(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return _d(ic)}function k3(i,o){if(i==="click")return _d(o)}function E3(i,o){if(i==="input"||i==="change")return _d(o)}function R3(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var hr=typeof Object.is=="function"?Object.is:R3;function sc(i,o){if(hr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var v=c[f];if(!xt.call(o,v)||!hr(i[v],o[v]))return!1}return!0}function gx(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vx(i,o){var c=gx(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=o&&f>=o)return{node:c,offset:o-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=gx(c)}}function _x(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?_x(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function yx(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=dd(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=dd(i.document)}return o}function om(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var T3=Ii&&"documentMode"in document&&11>=document.documentMode,El=null,lm=null,oc=null,am=!1;function bx(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;am||El==null||El!==dd(f)||(f=El,"selectionStart"in f&&om(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),oc&&sc(oc,f)||(oc=f,f=oh(lm,"onSelect"),0<f.length&&(o=new gd("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=El)))}function So(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var Rl={animationend:So("Animation","AnimationEnd"),animationiteration:So("Animation","AnimationIteration"),animationstart:So("Animation","AnimationStart"),transitionrun:So("Transition","TransitionRun"),transitionstart:So("Transition","TransitionStart"),transitioncancel:So("Transition","TransitionCancel"),transitionend:So("Transition","TransitionEnd")},cm={},xx={};Ii&&(xx=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function wo(i){if(cm[i])return cm[i];if(!Rl[i])return i;var o=Rl[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in xx)return cm[i]=o[c];return i}var Sx=wo("animationend"),wx=wo("animationiteration"),Cx=wo("animationstart"),M3=wo("transitionrun"),N3=wo("transitionstart"),A3=wo("transitioncancel"),kx=wo("transitionend"),Ex=new Map,um="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(" ");um.push("scrollEnd");function Zr(i,o){Ex.set(i,o),bo(o,[i])}var yd=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Nr=[],Tl=0,dm=0;function bd(){for(var i=Tl,o=dm=Tl=0;o<i;){var c=Nr[o];Nr[o++]=null;var f=Nr[o];Nr[o++]=null;var v=Nr[o];Nr[o++]=null;var x=Nr[o];if(Nr[o++]=null,f!==null&&v!==null){var E=f.pending;E===null?v.next=v:(v.next=E.next,E.next=v),f.pending=v}x!==0&&Rx(c,v,x)}}function xd(i,o,c,f){Nr[Tl++]=i,Nr[Tl++]=o,Nr[Tl++]=c,Nr[Tl++]=f,dm|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function hm(i,o,c,f){return xd(i,o,c,f),Sd(i)}function Co(i,o){return xd(i,null,null,o),Sd(i)}function Rx(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var v=!1,x=i.return;x!==null;)x.childLanes|=c,f=x.alternate,f!==null&&(f.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(v=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,v&&o!==null&&(v=31-ot(c),i=x.hiddenUpdates,f=i[v],f===null?i[v]=[o]:f.push(o),o.lane=c|536870912),x):null}function Sd(i){if(50<Tc)throw Tc=0,xg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Ml={};function D3(i,o,c,f){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=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(i,o,c,f){return new D3(i,o,c,f)}function fm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Hi(i,o){var c=i.alternate;return c===null?(c=fr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,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,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function Tx(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,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,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function wd(i,o,c,f,v,x){var E=0;if(f=i,typeof i=="function")fm(i)&&(E=1);else if(typeof i=="string")E=PO(i,c,oe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=fr(31,c,o,v),i.elementType=G,i.lanes=x,i;case w:return ko(c.children,v,x,o);case C:E=8,v|=24;break;case k:return i=fr(12,c,o,v|2),i.elementType=k,i.lanes=x,i;case O:return i=fr(13,c,o,v),i.elementType=O,i.lanes=x,i;case D:return i=fr(19,c,o,v),i.elementType=D,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case T:E=9;break e;case M:E=11;break e;case j:E=14;break e;case F:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=fr(E,c,o,v),o.elementType=i,o.type=f,o.lanes=x,o}function ko(i,o,c,f){return i=fr(7,i,f,o),i.lanes=c,i}function pm(i,o,c){return i=fr(6,i,null,o),i.lanes=c,i}function Mx(i){var o=fr(18,null,null,0);return o.stateNode=i,o}function mm(i,o,c){return o=fr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Nx=new WeakMap;function Ar(i,o){if(typeof i=="object"&&i!==null){var c=Nx.get(i);return c!==void 0?c:(o={value:i,source:o,stack:hn(o)},Nx.set(i,o),o)}return{value:i,source:o,stack:hn(o)}}var Nl=[],Al=0,Cd=null,lc=0,Dr=[],Or=0,ws=null,hi=1,fi="";function Fi(i,o){Nl[Al++]=lc,Nl[Al++]=Cd,Cd=i,lc=o}function Ax(i,o,c){Dr[Or++]=hi,Dr[Or++]=fi,Dr[Or++]=ws,ws=i;var f=hi;i=fi;var v=32-ot(f)-1;f&=~(1<<v),c+=1;var x=32-ot(o)+v;if(30<x){var E=v-v%5;x=(f&(1<<E)-1).toString(32),f>>=E,v-=E,hi=1<<32-ot(o)+v|c<<v|f,fi=x+i}else hi=1<<x|c<<v|f,fi=i}function gm(i){i.return!==null&&(Fi(i,1),Ax(i,1,0))}function vm(i){for(;i===Cd;)Cd=Nl[--Al],Nl[Al]=null,lc=Nl[--Al],Nl[Al]=null;for(;i===ws;)ws=Dr[--Or],Dr[Or]=null,fi=Dr[--Or],Dr[Or]=null,hi=Dr[--Or],Dr[Or]=null}function Dx(i,o){Dr[Or++]=hi,Dr[Or++]=fi,Dr[Or++]=ws,hi=o.id,fi=o.overflow,ws=i}var kn=null,Tt=null,it=!1,Cs=null,Lr=!1,_m=Error(r(519));function ks(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(Ar(o,i)),_m}function Ox(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[Cn]=i,o[Zn]=f,c){case"dialog":Qe("cancel",o),Qe("close",o);break;case"iframe":case"object":case"embed":Qe("load",o);break;case"video":case"audio":for(c=0;c<Nc.length;c++)Qe(Nc[c],o);break;case"source":Qe("error",o);break;case"img":case"image":case"link":Qe("error",o),Qe("load",o);break;case"details":Qe("toggle",o);break;case"input":Qe("invalid",o),q0(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Qe("invalid",o);break;case"textarea":Qe("invalid",o),G0(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||XS(o.textContent,c)?(f.popover!=null&&(Qe("beforetoggle",o),Qe("toggle",o)),f.onScroll!=null&&Qe("scroll",o),f.onScrollEnd!=null&&Qe("scrollend",o),f.onClick!=null&&(o.onclick=Bi),o=!0):o=!1,o||ks(i,!0)}function Lx(i){for(kn=i.return;kn;)switch(kn.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:kn=kn.return}}function Dl(i){if(i!==kn)return!1;if(!it)return Lx(i),it=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||zg(i.type,i.memoizedProps)),c=!c),c&&Tt&&ks(i),Lx(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tt=sw(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tt=sw(i)}else o===27?(o=Tt,Is(i.type)?(i=Fg,Fg=null,Tt=i):Tt=o):Tt=kn?zr(i.stateNode.nextSibling):null;return!0}function Eo(){Tt=kn=null,it=!1}function ym(){var i=Cs;return i!==null&&(nr===null?nr=i:nr.push.apply(nr,i),Cs=null),i}function ac(i){Cs===null?Cs=[i]:Cs.push(i)}var bm=z(null),Ro=null,Ui=null;function Es(i,o,c){A(bm,o._currentValue),o._currentValue=c}function $i(i){i._currentValue=bm.current,Y(bm)}function xm(i,o,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===c)break;i=i.return}}function Sm(i,o,c,f){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var x=v.dependencies;if(x!==null){var E=v.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=v;for(var K=0;K<o.length;K++)if(L.context===o[K]){x.lanes|=c,L=x.alternate,L!==null&&(L.lanes|=c),xm(x.return,c,i),f||(E=null);break e}x=L.next}}else if(v.tag===18){if(E=v.return,E===null)throw Error(r(341));E.lanes|=c,x=E.alternate,x!==null&&(x.lanes|=c),xm(E,c,i),E=null}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===i){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}}function Ol(i,o,c,f){i=null;for(var v=o,x=!1;v!==null;){if(!x){if((v.flags&524288)!==0)x=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var E=v.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var L=v.type;hr(v.pendingProps.value,E.value)||(i!==null?i.push(L):i=[L])}}else if(v===J.current){if(E=v.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(jc):i=[jc])}v=v.return}i!==null&&Sm(o,i,c,f),o.flags|=262144}function kd(i){for(i=i.firstContext;i!==null;){if(!hr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function To(i){Ro=i,Ui=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function En(i){return jx(Ro,i)}function Ed(i,o){return Ro===null&&To(i),jx(i,o)}function jx(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Ui===null){if(i===null)throw Error(r(308));Ui=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else Ui=Ui.next=o;return c}var O3=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},L3=e.unstable_scheduleCallback,j3=e.unstable_NormalPriority,Yt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wm(){return{controller:new O3,data:new Map,refCount:0}}function cc(i){i.refCount--,i.refCount===0&&L3(j3,function(){i.controller.abort()})}var uc=null,Cm=0,Ll=0,jl=null;function z3(i,o){if(uc===null){var c=uc=[];Cm=0,Ll=Rg(),jl={status:"pending",value:void 0,then:function(f){c.push(f)}}}return Cm++,o.then(zx,zx),o}function zx(){if(--Cm===0&&uc!==null){jl!==null&&(jl.status="fulfilled");var i=uc;uc=null,Ll=0,jl=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function P3(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(f.status="rejected",f.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),f}var Px=B.S;B.S=function(i,o){bS=le(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&z3(i,o),Px!==null&&Px(i,o)};var Mo=z(null);function km(){var i=Mo.current;return i!==null?i:St.pooledCache}function Rd(i,o){o===null?A(Mo,Mo.current):A(Mo,o.pool)}function Bx(){var i=km();return i===null?null:{parent:Yt._currentValue,pool:i}}var zl=Error(r(460)),Em=Error(r(474)),Td=Error(r(542)),Md={then:function(){}};function Ix(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Hx(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Bi,Bi),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ux(i),i;default:if(typeof o.status=="string")o.then(Bi,Bi);else{if(i=St,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=f}},function(f){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ux(i),i}throw Ao=o,zl}}function No(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ao=c,zl):c}}var Ao=null;function Fx(){if(Ao===null)throw Error(r(459));var i=Ao;return Ao=null,i}function Ux(i){if(i===zl||i===Td)throw Error(r(483))}var Pl=null,dc=0;function Nd(i){var o=dc;return dc+=1,Pl===null&&(Pl=[]),Hx(Pl,i,o)}function hc(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Ad(i,o){throw o.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function $x(i){function o(Q,X){if(i){var ee=Q.deletions;ee===null?(Q.deletions=[X],Q.flags|=16):ee.push(X)}}function c(Q,X){if(!i)return null;for(;X!==null;)o(Q,X),X=X.sibling;return null}function f(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function v(Q,X){return Q=Hi(Q,X),Q.index=0,Q.sibling=null,Q}function x(Q,X,ee){return Q.index=ee,i?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<X?(Q.flags|=67108866,X):ee):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function E(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function L(Q,X,ee,he){return X===null||X.tag!==6?(X=pm(ee,Q.mode,he),X.return=Q,X):(X=v(X,ee),X.return=Q,X)}function K(Q,X,ee,he){var je=ee.type;return je===w?de(Q,X,ee.props.children,he,ee.key):X!==null&&(X.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===F&&No(je)===X.type)?(X=v(X,ee.props),hc(X,ee),X.return=Q,X):(X=wd(ee.type,ee.key,ee.props,null,Q.mode,he),hc(X,ee),X.return=Q,X)}function te(Q,X,ee,he){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=mm(ee,Q.mode,he),X.return=Q,X):(X=v(X,ee.children||[]),X.return=Q,X)}function de(Q,X,ee,he,je){return X===null||X.tag!==7?(X=ko(ee,Q.mode,he,je),X.return=Q,X):(X=v(X,ee),X.return=Q,X)}function pe(Q,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=pm(""+X,Q.mode,ee),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case y:return ee=wd(X.type,X.key,X.props,null,Q.mode,ee),hc(ee,X),ee.return=Q,ee;case S:return X=mm(X,Q.mode,ee),X.return=Q,X;case F:return X=No(X),pe(Q,X,ee)}if(H(X)||I(X))return X=ko(X,Q.mode,ee,null),X.return=Q,X;if(typeof X.then=="function")return pe(Q,Nd(X),ee);if(X.$$typeof===R)return pe(Q,Ed(Q,X),ee);Ad(Q,X)}return null}function ne(Q,X,ee,he){var je=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return je!==null?null:L(Q,X,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ee.key===je?K(Q,X,ee,he):null;case S:return ee.key===je?te(Q,X,ee,he):null;case F:return ee=No(ee),ne(Q,X,ee,he)}if(H(ee)||I(ee))return je!==null?null:de(Q,X,ee,he,null);if(typeof ee.then=="function")return ne(Q,X,Nd(ee),he);if(ee.$$typeof===R)return ne(Q,X,Ed(Q,ee),he);Ad(Q,ee)}return null}function ae(Q,X,ee,he,je){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ee)||null,L(X,Q,""+he,je);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return Q=Q.get(he.key===null?ee:he.key)||null,K(X,Q,he,je);case S:return Q=Q.get(he.key===null?ee:he.key)||null,te(X,Q,he,je);case F:return he=No(he),ae(Q,X,ee,he,je)}if(H(he)||I(he))return Q=Q.get(ee)||null,de(X,Q,he,je,null);if(typeof he.then=="function")return ae(Q,X,ee,Nd(he),je);if(he.$$typeof===R)return ae(Q,X,ee,Ed(X,he),je);Ad(X,he)}return null}function Te(Q,X,ee,he){for(var je=null,at=null,De=X,We=X=0,nt=null;De!==null&&We<ee.length;We++){De.index>We?(nt=De,De=null):nt=De.sibling;var ct=ne(Q,De,ee[We],he);if(ct===null){De===null&&(De=nt);break}i&&De&&ct.alternate===null&&o(Q,De),X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct,De=nt}if(We===ee.length)return c(Q,De),it&&Fi(Q,We),je;if(De===null){for(;We<ee.length;We++)De=pe(Q,ee[We],he),De!==null&&(X=x(De,X,We),at===null?je=De:at.sibling=De,at=De);return it&&Fi(Q,We),je}for(De=f(De);We<ee.length;We++)nt=ae(De,Q,We,ee[We],he),nt!==null&&(i&&nt.alternate!==null&&De.delete(nt.key===null?We:nt.key),X=x(nt,X,We),at===null?je=nt:at.sibling=nt,at=nt);return i&&De.forEach(function(Ws){return o(Q,Ws)}),it&&Fi(Q,We),je}function Pe(Q,X,ee,he){if(ee==null)throw Error(r(151));for(var je=null,at=null,De=X,We=X=0,nt=null,ct=ee.next();De!==null&&!ct.done;We++,ct=ee.next()){De.index>We?(nt=De,De=null):nt=De.sibling;var Ws=ne(Q,De,ct.value,he);if(Ws===null){De===null&&(De=nt);break}i&&De&&Ws.alternate===null&&o(Q,De),X=x(Ws,X,We),at===null?je=Ws:at.sibling=Ws,at=Ws,De=nt}if(ct.done)return c(Q,De),it&&Fi(Q,We),je;if(De===null){for(;!ct.done;We++,ct=ee.next())ct=pe(Q,ct.value,he),ct!==null&&(X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct);return it&&Fi(Q,We),je}for(De=f(De);!ct.done;We++,ct=ee.next())ct=ae(De,Q,We,ct.value,he),ct!==null&&(i&&ct.alternate!==null&&De.delete(ct.key===null?We:ct.key),X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct);return i&&De.forEach(function(GO){return o(Q,GO)}),it&&Fi(Q,We),je}function vt(Q,X,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:e:{for(var je=ee.key;X!==null;){if(X.key===je){if(je=ee.type,je===w){if(X.tag===7){c(Q,X.sibling),he=v(X,ee.props.children),he.return=Q,Q=he;break e}}else if(X.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===F&&No(je)===X.type){c(Q,X.sibling),he=v(X,ee.props),hc(he,ee),he.return=Q,Q=he;break e}c(Q,X);break}else o(Q,X);X=X.sibling}ee.type===w?(he=ko(ee.props.children,Q.mode,he,ee.key),he.return=Q,Q=he):(he=wd(ee.type,ee.key,ee.props,null,Q.mode,he),hc(he,ee),he.return=Q,Q=he)}return E(Q);case S:e:{for(je=ee.key;X!==null;){if(X.key===je)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){c(Q,X.sibling),he=v(X,ee.children||[]),he.return=Q,Q=he;break e}else{c(Q,X);break}else o(Q,X);X=X.sibling}he=mm(ee,Q.mode,he),he.return=Q,Q=he}return E(Q);case F:return ee=No(ee),vt(Q,X,ee,he)}if(H(ee))return Te(Q,X,ee,he);if(I(ee)){if(je=I(ee),typeof je!="function")throw Error(r(150));return ee=je.call(ee),Pe(Q,X,ee,he)}if(typeof ee.then=="function")return vt(Q,X,Nd(ee),he);if(ee.$$typeof===R)return vt(Q,X,Ed(Q,ee),he);Ad(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(c(Q,X.sibling),he=v(X,ee),he.return=Q,Q=he):(c(Q,X),he=pm(ee,Q.mode,he),he.return=Q,Q=he),E(Q)):c(Q,X)}return function(Q,X,ee,he){try{dc=0;var je=vt(Q,X,ee,he);return Pl=null,je}catch(De){if(De===zl||De===Td)throw De;var at=fr(29,De,null,Q.mode);return at.lanes=he,at.return=Q,at}finally{}}}var Do=$x(!0),Wx=$x(!1),Rs=!1;function Rm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tm(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ts(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ms(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(ut&2)!==0){var v=f.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),f.pending=o,o=Sd(i),Rx(i,null,c),o}return xd(i,f,o,c),Sd(i)}function fc(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,dr(i,c)}}function Mm(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var v=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?v=x=E:x=x.next=E,c=c.next}while(c!==null);x===null?v=x=o:x=x.next=o}else v=x=o;c={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var Nm=!1;function pc(){if(Nm){var i=jl;if(i!==null)throw i}}function mc(i,o,c,f){Nm=!1;var v=i.updateQueue;Rs=!1;var x=v.firstBaseUpdate,E=v.lastBaseUpdate,L=v.shared.pending;if(L!==null){v.shared.pending=null;var K=L,te=K.next;K.next=null,E===null?x=te:E.next=te,E=K;var de=i.alternate;de!==null&&(de=de.updateQueue,L=de.lastBaseUpdate,L!==E&&(L===null?de.firstBaseUpdate=te:L.next=te,de.lastBaseUpdate=K))}if(x!==null){var pe=v.baseState;E=0,de=te=K=null,L=x;do{var ne=L.lane&-536870913,ae=ne!==L.lane;if(ae?(tt&ne)===ne:(f&ne)===ne){ne!==0&&ne===Ll&&(Nm=!0),de!==null&&(de=de.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Te=i,Pe=L;ne=o;var vt=c;switch(Pe.tag){case 1:if(Te=Pe.payload,typeof Te=="function"){pe=Te.call(vt,pe,ne);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Pe.payload,ne=typeof Te=="function"?Te.call(vt,pe,ne):Te,ne==null)break e;pe=m({},pe,ne);break e;case 2:Rs=!0}}ne=L.callback,ne!==null&&(i.flags|=64,ae&&(i.flags|=8192),ae=v.callbacks,ae===null?v.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:L.tag,payload:L.payload,callback:L.callback,next:null},de===null?(te=de=ae,K=pe):de=de.next=ae,E|=ne;if(L=L.next,L===null){if(L=v.shared.pending,L===null)break;ae=L,L=ae.next,ae.next=null,v.lastBaseUpdate=ae,v.shared.pending=null}}while(!0);de===null&&(K=pe),v.baseState=K,v.firstBaseUpdate=te,v.lastBaseUpdate=de,x===null&&(v.shared.lanes=0),Ls|=E,i.lanes=E,i.memoizedState=pe}}function Vx(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function qx(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)Vx(c[i],o)}var Bl=z(null),Dd=z(0);function Kx(i,o){i=Qi,A(Dd,i),A(Bl,o),Qi=i|o.baseLanes}function Am(){A(Dd,Qi),A(Bl,Bl.current)}function Dm(){Qi=Dd.current,Y(Bl),Y(Dd)}var pr=z(null),jr=null;function Ns(i){var o=i.alternate;A(Vt,Vt.current&1),A(pr,i),jr===null&&(o===null||Bl.current!==null||o.memoizedState!==null)&&(jr=i)}function Om(i){A(Vt,Vt.current),A(pr,i),jr===null&&(jr=i)}function Gx(i){i.tag===22?(A(Vt,Vt.current),A(pr,i),jr===null&&(jr=i)):As()}function As(){A(Vt,Vt.current),A(pr,pr.current)}function mr(i){Y(pr),jr===i&&(jr=null),Y(Vt)}var Vt=z(0);function Od(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ig(c)||Hg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Wi=0,$e=null,mt=null,Xt=null,Ld=!1,Il=!1,Oo=!1,jd=0,gc=0,Hl=null,B3=0;function Ht(){throw Error(r(321))}function Lm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!hr(i[c],o[c]))return!1;return!0}function jm(i,o,c,f,v,x){return Wi=x,$e=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=i===null||i.memoizedState===null?A1:Xm,Oo=!1,x=c(f,v),Oo=!1,Il&&(x=Xx(o,c,f,v)),Yx(i),x}function Yx(i){B.H=yc;var o=mt!==null&&mt.next!==null;if(Wi=0,Xt=mt=$e=null,Ld=!1,gc=0,Hl=null,o)throw Error(r(300));i===null||Zt||(i=i.dependencies,i!==null&&kd(i)&&(Zt=!0))}function Xx(i,o,c,f){$e=i;var v=0;do{if(Il&&(Hl=null),gc=0,Il=!1,25<=v)throw Error(r(301));if(v+=1,Xt=mt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}B.H=D1,x=o(c,f)}while(Il);return x}function I3(){var i=B.H,o=i.useState()[0];return o=typeof o.then=="function"?vc(o):o,i=i.useState()[0],(mt!==null?mt.memoizedState:null)!==i&&($e.flags|=1024),o}function zm(){var i=jd!==0;return jd=0,i}function Pm(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Bm(i){if(Ld){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Ld=!1}Wi=0,Xt=mt=$e=null,Il=!1,gc=jd=0,Hl=null}function Hn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?$e.memoizedState=Xt=i:Xt=Xt.next=i,Xt}function qt(){if(mt===null){var i=$e.alternate;i=i!==null?i.memoizedState:null}else i=mt.next;var o=Xt===null?$e.memoizedState:Xt.next;if(o!==null)Xt=o,mt=i;else{if(i===null)throw $e.alternate===null?Error(r(467)):Error(r(310));mt=i,i={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Xt===null?$e.memoizedState=Xt=i:Xt=Xt.next=i}return Xt}function zd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vc(i){var o=gc;return gc+=1,Hl===null&&(Hl=[]),i=Hx(Hl,i,o),o=$e,(Xt===null?o.memoizedState:Xt.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?A1:Xm),i}function Pd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return vc(i);if(i.$$typeof===R)return En(i)}throw Error(r(438,String(i)))}function Im(i){var o=null,c=$e.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=$e.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=zd(),$e.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=P;return o.index++,c}function Vi(i,o){return typeof o=="function"?o(i):o}function Bd(i){var o=qt();return Hm(o,mt,i)}function Hm(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var v=i.baseQueue,x=f.pending;if(x!==null){if(v!==null){var E=v.next;v.next=x.next,x.next=E}o.baseQueue=v=x,f.pending=null}if(x=i.baseState,v===null)i.memoizedState=x;else{o=v.next;var L=E=null,K=null,te=o,de=!1;do{var pe=te.lane&-536870913;if(pe!==te.lane?(tt&pe)===pe:(Wi&pe)===pe){var ne=te.revertLane;if(ne===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),pe===Ll&&(de=!0);else if((Wi&ne)===ne){te=te.next,ne===Ll&&(de=!0);continue}else pe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(L=K=pe,E=x):K=K.next=pe,$e.lanes|=ne,Ls|=ne;pe=te.action,Oo&&c(x,pe),x=te.hasEagerState?te.eagerState:c(x,pe)}else ne={lane:pe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(L=K=ne,E=x):K=K.next=ne,$e.lanes|=pe,Ls|=pe;te=te.next}while(te!==null&&te!==o);if(K===null?E=x:K.next=L,!hr(x,i.memoizedState)&&(Zt=!0,de&&(c=jl,c!==null)))throw c;i.memoizedState=x,i.baseState=E,i.baseQueue=K,f.lastRenderedState=x}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Fm(i){var o=qt(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,v=c.pending,x=o.memoizedState;if(v!==null){c.pending=null;var E=v=v.next;do x=i(x,E.action),E=E.next;while(E!==v);hr(x,o.memoizedState)||(Zt=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),c.lastRenderedState=x}return[x,f]}function Zx(i,o,c){var f=$e,v=qt(),x=it;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!hr((mt||v).memoizedState,c);if(E&&(v.memoizedState=c,Zt=!0),v=v.queue,Wm(e1.bind(null,f,v,i),[i]),v.getSnapshot!==o||E||Xt!==null&&Xt.memoizedState.tag&1){if(f.flags|=2048,Fl(9,{destroy:void 0},Jx.bind(null,f,v,c,o),null),St===null)throw Error(r(349));x||(Wi&127)!==0||Qx(f,o,c)}return c}function Qx(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=$e.updateQueue,o===null?(o=zd(),$e.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function Jx(i,o,c,f){o.value=c,o.getSnapshot=f,t1(o)&&n1(i)}function e1(i,o,c){return c(function(){t1(o)&&n1(i)})}function t1(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!hr(i,c)}catch{return!0}}function n1(i){var o=Co(i,2);o!==null&&rr(o,i,2)}function Um(i){var o=Hn();if(typeof i=="function"){var c=i;if(i=c(),Oo){Gt(!0);try{c()}finally{Gt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:i},o}function r1(i,o,c,f){return i.baseState=c,Hm(i,mt,typeof f=="function"?f:Vi)}function H3(i,o,c,f,v){if(Fd(i))throw Error(r(485));if(i=o.action,i!==null){var x={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};B.T!==null?c(!0):x.isTransition=!1,f(x),c=o.pending,c===null?(x.next=o.pending=x,i1(o,x)):(x.next=c.next,o.pending=c.next=x)}}function i1(i,o){var c=o.action,f=o.payload,v=i.state;if(o.isTransition){var x=B.T,E={};B.T=E;try{var L=c(v,f),K=B.S;K!==null&&K(E,L),s1(i,o,L)}catch(te){$m(i,o,te)}finally{x!==null&&E.types!==null&&(x.types=E.types),B.T=x}}else try{x=c(v,f),s1(i,o,x)}catch(te){$m(i,o,te)}}function s1(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){o1(i,o,f)},function(f){return $m(i,o,f)}):o1(i,o,c)}function o1(i,o,c){o.status="fulfilled",o.value=c,l1(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,i1(i,c)))}function $m(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,l1(o),o=o.next;while(o!==f)}i.action=null}function l1(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function a1(i,o){return o}function c1(i,o){if(it){var c=St.formState;if(c!==null){e:{var f=$e;if(it){if(Tt){t:{for(var v=Tt,x=Lr;v.nodeType!==8;){if(!x){v=null;break t}if(v=zr(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){Tt=zr(v.nextSibling),f=v.data==="F!";break e}}ks(f)}f=!1}f&&(o=c[0])}}return c=Hn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a1,lastRenderedState:o},c.queue=f,c=T1.bind(null,$e,f),f.dispatch=c,f=Um(!1),x=Ym.bind(null,$e,!1,f.queue),f=Hn(),v={state:o,dispatch:null,action:i,pending:null},f.queue=v,c=H3.bind(null,$e,v,x,c),v.dispatch=c,f.memoizedState=i,[o,c,!1]}function u1(i){var o=qt();return d1(o,mt,i)}function d1(i,o,c){if(o=Hm(i,o,a1)[0],i=Bd(Vi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=vc(o)}catch(E){throw E===zl?Td:E}else f=o;o=qt();var v=o.queue,x=v.dispatch;return c!==o.memoizedState&&($e.flags|=2048,Fl(9,{destroy:void 0},F3.bind(null,v,c),null)),[f,x,i]}function F3(i,o){i.action=o}function h1(i){var o=qt(),c=mt;if(c!==null)return d1(o,c,i);qt(),o=o.memoizedState,c=qt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function Fl(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=$e.updateQueue,o===null&&(o=zd(),$e.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,o.lastEffect=i),i}function f1(){return qt().memoizedState}function Id(i,o,c,f){var v=Hn();$e.flags|=i,v.memoizedState=Fl(1|o,{destroy:void 0},c,f===void 0?null:f)}function Hd(i,o,c,f){var v=qt();f=f===void 0?null:f;var x=v.memoizedState.inst;mt!==null&&f!==null&&Lm(f,mt.memoizedState.deps)?v.memoizedState=Fl(o,x,c,f):($e.flags|=i,v.memoizedState=Fl(1|o,x,c,f))}function p1(i,o){Id(8390656,8,i,o)}function Wm(i,o){Hd(2048,8,i,o)}function U3(i){$e.flags|=4;var o=$e.updateQueue;if(o===null)o=zd(),$e.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function m1(i){var o=qt().memoizedState;return U3({ref:o,nextImpl:i}),function(){if((ut&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function g1(i,o){return Hd(4,2,i,o)}function v1(i,o){return Hd(4,4,i,o)}function _1(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function y1(i,o,c){c=c!=null?c.concat([i]):null,Hd(4,4,_1.bind(null,o,i),c)}function Vm(){}function b1(i,o){var c=qt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&Lm(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function x1(i,o){var c=qt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&Lm(o,f[1]))return f[0];if(f=i(),Oo){Gt(!0);try{i()}finally{Gt(!1)}}return c.memoizedState=[f,o],f}function qm(i,o,c){return c===void 0||(Wi&1073741824)!==0&&(tt&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=SS(),$e.lanes|=i,Ls|=i,c)}function S1(i,o,c,f){return hr(c,o)?c:Bl.current!==null?(i=qm(i,c,f),hr(i,o)||(Zt=!0),i):(Wi&42)===0||(Wi&1073741824)!==0&&(tt&261930)===0?(Zt=!0,i.memoizedState=c):(i=SS(),$e.lanes|=i,Ls|=i,o)}function w1(i,o,c,f,v){var x=q.p;q.p=x!==0&&8>x?x:8;var E=B.T,L={};B.T=L,Ym(i,!1,o,c);try{var K=v(),te=B.S;if(te!==null&&te(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var de=P3(K,f);_c(i,o,de,_r(i))}else _c(i,o,f,_r(i))}catch(pe){_c(i,o,{then:function(){},status:"rejected",reason:pe},_r())}finally{q.p=x,E!==null&&L.types!==null&&(E.types=L.types),B.T=E}}function $3(){}function Km(i,o,c,f){if(i.tag!==5)throw Error(r(476));var v=C1(i).queue;w1(i,v,o,V,c===null?$3:function(){return k1(i),c(f)})}function C1(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:V},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function k1(i){var o=C1(i);o.next===null&&(o=i.alternate.memoizedState),_c(i,o.next.queue,{},_r())}function Gm(){return En(jc)}function E1(){return qt().memoizedState}function R1(){return qt().memoizedState}function W3(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=_r();i=Ts(c);var f=Ms(o,i,c);f!==null&&(rr(f,o,c),fc(f,o,c)),o={cache:wm()},i.payload=o;return}o=o.return}}function V3(i,o,c){var f=_r();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Fd(i)?M1(o,c):(c=hm(i,o,c,f),c!==null&&(rr(c,i,f),N1(c,o,f)))}function T1(i,o,c){var f=_r();_c(i,o,c,f)}function _c(i,o,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Fd(i))M1(o,v);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var E=o.lastRenderedState,L=x(E,c);if(v.hasEagerState=!0,v.eagerState=L,hr(L,E))return xd(i,o,v,0),St===null&&bd(),!1}catch{}finally{}if(c=hm(i,o,v,f),c!==null)return rr(c,i,f),N1(c,o,f),!0}return!1}function Ym(i,o,c,f){if(f={lane:2,revertLane:Rg(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Fd(i)){if(o)throw Error(r(479))}else o=hm(i,c,f,2),o!==null&&rr(o,i,2)}function Fd(i){var o=i.alternate;return i===$e||o!==null&&o===$e}function M1(i,o){Il=Ld=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function N1(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,dr(i,c)}}var yc={readContext:En,use:Pd,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};yc.useEffectEvent=Ht;var A1={readContext:En,use:Pd,useCallback:function(i,o){return Hn().memoizedState=[i,o===void 0?null:o],i},useContext:En,useEffect:p1,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,Id(4194308,4,_1.bind(null,o,i),c)},useLayoutEffect:function(i,o){return Id(4194308,4,i,o)},useInsertionEffect:function(i,o){Id(4,2,i,o)},useMemo:function(i,o){var c=Hn();o=o===void 0?null:o;var f=i();if(Oo){Gt(!0);try{i()}finally{Gt(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Hn();if(c!==void 0){var v=c(o);if(Oo){Gt(!0);try{c(o)}finally{Gt(!1)}}}else v=o;return f.memoizedState=f.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},f.queue=i,i=i.dispatch=V3.bind(null,$e,i),[f.memoizedState,i]},useRef:function(i){var o=Hn();return i={current:i},o.memoizedState=i},useState:function(i){i=Um(i);var o=i.queue,c=T1.bind(null,$e,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:Vm,useDeferredValue:function(i,o){var c=Hn();return qm(c,i,o)},useTransition:function(){var i=Um(!1);return i=w1.bind(null,$e,i.queue,!0,!1),Hn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=$e,v=Hn();if(it){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),St===null)throw Error(r(349));(tt&127)!==0||Qx(f,o,c)}v.memoizedState=c;var x={value:c,getSnapshot:o};return v.queue=x,p1(e1.bind(null,f,x,i),[i]),f.flags|=2048,Fl(9,{destroy:void 0},Jx.bind(null,f,x,c,o),null),c},useId:function(){var i=Hn(),o=St.identifierPrefix;if(it){var c=fi,f=hi;c=(f&~(1<<32-ot(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=jd++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=B3++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Gm,useFormState:c1,useActionState:c1,useOptimistic:function(i){var o=Hn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Ym.bind(null,$e,!0,c),c.dispatch=o,[i,o]},useMemoCache:Im,useCacheRefresh:function(){return Hn().memoizedState=W3.bind(null,$e)},useEffectEvent:function(i){var o=Hn(),c={impl:i};return o.memoizedState=c,function(){if((ut&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Xm={readContext:En,use:Pd,useCallback:b1,useContext:En,useEffect:Wm,useImperativeHandle:y1,useInsertionEffect:g1,useLayoutEffect:v1,useMemo:x1,useReducer:Bd,useRef:f1,useState:function(){return Bd(Vi)},useDebugValue:Vm,useDeferredValue:function(i,o){var c=qt();return S1(c,mt.memoizedState,i,o)},useTransition:function(){var i=Bd(Vi)[0],o=qt().memoizedState;return[typeof i=="boolean"?i:vc(i),o]},useSyncExternalStore:Zx,useId:E1,useHostTransitionStatus:Gm,useFormState:u1,useActionState:u1,useOptimistic:function(i,o){var c=qt();return r1(c,mt,i,o)},useMemoCache:Im,useCacheRefresh:R1};Xm.useEffectEvent=m1;var D1={readContext:En,use:Pd,useCallback:b1,useContext:En,useEffect:Wm,useImperativeHandle:y1,useInsertionEffect:g1,useLayoutEffect:v1,useMemo:x1,useReducer:Fm,useRef:f1,useState:function(){return Fm(Vi)},useDebugValue:Vm,useDeferredValue:function(i,o){var c=qt();return mt===null?qm(c,i,o):S1(c,mt.memoizedState,i,o)},useTransition:function(){var i=Fm(Vi)[0],o=qt().memoizedState;return[typeof i=="boolean"?i:vc(i),o]},useSyncExternalStore:Zx,useId:E1,useHostTransitionStatus:Gm,useFormState:h1,useActionState:h1,useOptimistic:function(i,o){var c=qt();return mt!==null?r1(c,mt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Im,useCacheRefresh:R1};D1.useEffectEvent=m1;function Zm(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:m({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Qm={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=_r(),v=Ts(f);v.payload=o,c!=null&&(v.callback=c),o=Ms(i,v,f),o!==null&&(rr(o,i,f),fc(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=_r(),v=Ts(f);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Ms(i,v,f),o!==null&&(rr(o,i,f),fc(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=_r(),f=Ts(c);f.tag=2,o!=null&&(f.callback=o),o=Ms(i,f,c),o!==null&&(rr(o,i,c),fc(o,i,c))}};function O1(i,o,c,f,v,x,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,x,E):o.prototype&&o.prototype.isPureReactComponent?!sc(c,f)||!sc(v,x):!0}function L1(i,o,c,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==i&&Qm.enqueueReplaceState(o,o.state,null)}function Lo(i,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(i=i.defaultProps){c===o&&(c=m({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function j1(i){yd(i)}function z1(i){console.error(i)}function P1(i){yd(i)}function Ud(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function B1(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Jm(i,o,c){return c=Ts(c),c.tag=3,c.payload={element:null},c.callback=function(){Ud(i,o)},c}function I1(i){return i=Ts(i),i.tag=3,i}function H1(i,o,c,f){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var x=f.value;i.payload=function(){return v(x)},i.callback=function(){B1(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){B1(o,c,f),typeof v!="function"&&(js===null?js=new Set([this]):js.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})})}function q3(i,o,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&Ol(o,c,v,!0),c=pr.current,c!==null){switch(c.tag){case 31:case 13:return jr===null?eh():c.alternate===null&&Ft===0&&(Ft=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===Md?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),Cg(i,f,v)),!1;case 22:return c.flags|=65536,f===Md?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),Cg(i,f,v)),!1}throw Error(r(435,c.tag))}return Cg(i,f,v),eh(),!1}if(it)return o=pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,f!==_m&&(i=Error(r(422),{cause:f}),ac(Ar(i,c)))):(f!==_m&&(o=Error(r(423),{cause:f}),ac(Ar(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=Ar(f,c),v=Jm(i.stateNode,f,v),Mm(i,v),Ft!==4&&(Ft=2)),!1;var x=Error(r(520),{cause:f});if(x=Ar(x,c),Rc===null?Rc=[x]:Rc.push(x),Ft!==4&&(Ft=2),o===null)return!0;f=Ar(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=Jm(c.stateNode,f,i),Mm(c,i),!1;case 1:if(o=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(js===null||!js.has(x))))return c.flags|=65536,v&=-v,c.lanes|=v,v=I1(v),H1(v,i,c,f),Mm(c,v),!1}c=c.return}while(c!==null);return!1}var eg=Error(r(461)),Zt=!1;function Rn(i,o,c,f){o.child=i===null?Wx(o,null,c,f):Do(o,i.child,c,f)}function F1(i,o,c,f,v){c=c.render;var x=o.ref;if("ref"in f){var E={};for(var L in f)L!=="ref"&&(E[L]=f[L])}else E=f;return To(o),f=jm(i,o,c,E,x,v),L=zm(),i!==null&&!Zt?(Pm(i,o,v),qi(i,o,v)):(it&&L&&gm(o),o.flags|=1,Rn(i,o,f,v),o.child)}function U1(i,o,c,f,v){if(i===null){var x=c.type;return typeof x=="function"&&!fm(x)&&x.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=x,$1(i,o,x,f,v)):(i=wd(c.type,null,f,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,!ag(i,v)){var E=x.memoizedProps;if(c=c.compare,c=c!==null?c:sc,c(E,f)&&i.ref===o.ref)return qi(i,o,v)}return o.flags|=1,i=Hi(x,f),i.ref=o.ref,i.return=o,o.child=i}function $1(i,o,c,f,v){if(i!==null){var x=i.memoizedProps;if(sc(x,f)&&i.ref===o.ref)if(Zt=!1,o.pendingProps=f=x,ag(i,v))(i.flags&131072)!==0&&(Zt=!0);else return o.lanes=i.lanes,qi(i,o,v)}return tg(i,o,c,f,v)}function W1(i,o,c,f){var v=f.children,x=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,i!==null){for(f=o.child=i.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~x}else f=0,o.child=null;return V1(i,o,x,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Rd(o,x!==null?x.cachePool:null),x!==null?Kx(o,x):Am(),Gx(o);else return f=o.lanes=536870912,V1(i,o,x!==null?x.baseLanes|c:c,c,f)}else x!==null?(Rd(o,x.cachePool),Kx(o,x),As(),o.memoizedState=null):(i!==null&&Rd(o,null),Am(),As());return Rn(i,o,v,c),o.child}function bc(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function V1(i,o,c,f,v){var x=km();return x=x===null?null:{parent:Yt._currentValue,pool:x},o.memoizedState={baseLanes:c,cachePool:x},i!==null&&Rd(o,null),Am(),Gx(o),i!==null&&Ol(i,o,f,!0),o.childLanes=v,null}function $d(i,o){return o=Vd({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function q1(i,o,c){return Do(o,i.child,null,c),i=$d(o,o.pendingProps),i.flags|=2,mr(o),o.memoizedState=null,i}function K3(i,o,c){var f=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(it){if(f.mode==="hidden")return i=$d(o,f),o.lanes=536870912,bc(null,i);if(Om(o),(i=Tt)?(i=iw(i,Lr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ws!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Mx(i),c.return=o,o.child=c,kn=o,Tt=null)):i=null,i===null)throw ks(o);return o.lanes=536870912,null}return $d(o,f)}var x=i.memoizedState;if(x!==null){var E=x.dehydrated;if(Om(o),v)if(o.flags&256)o.flags&=-257,o=q1(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(Zt||Ol(i,o,c,!1),v=(c&i.childLanes)!==0,Zt||v){if(f=St,f!==null&&(E=Er(f,c),E!==0&&E!==x.retryLane))throw x.retryLane=E,Co(i,E),rr(f,i,E),eg;eh(),o=q1(i,o,c)}else i=x.treeContext,Tt=zr(E.nextSibling),kn=o,it=!0,Cs=null,Lr=!1,i!==null&&Dx(o,i),o=$d(o,f),o.flags|=4096;return o}return i=Hi(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Wd(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function tg(i,o,c,f,v){return To(o),c=jm(i,o,c,f,void 0,v),f=zm(),i!==null&&!Zt?(Pm(i,o,v),qi(i,o,v)):(it&&f&&gm(o),o.flags|=1,Rn(i,o,c,v),o.child)}function K1(i,o,c,f,v,x){return To(o),o.updateQueue=null,c=Xx(o,f,c,v),Yx(i),f=zm(),i!==null&&!Zt?(Pm(i,o,x),qi(i,o,x)):(it&&f&&gm(o),o.flags|=1,Rn(i,o,c,x),o.child)}function G1(i,o,c,f,v){if(To(o),o.stateNode===null){var x=Ml,E=c.contextType;typeof E=="object"&&E!==null&&(x=En(E)),x=new c(f,x),o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Qm,o.stateNode=x,x._reactInternals=o,x=o.stateNode,x.props=f,x.state=o.memoizedState,x.refs={},Rm(o),E=c.contextType,x.context=typeof E=="object"&&E!==null?En(E):Ml,x.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Zm(o,c,E,f),x.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&Qm.enqueueReplaceState(x,x.state,null),mc(o,f,x,v),pc(),x.state=o.memoizedState),typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){x=o.stateNode;var L=o.memoizedProps,K=Lo(c,L);x.props=K;var te=x.context,de=c.contextType;E=Ml,typeof de=="object"&&de!==null&&(E=En(de));var pe=c.getDerivedStateFromProps;de=typeof pe=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=o.pendingProps!==L,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||te!==E)&&L1(o,x,f,E),Rs=!1;var ne=o.memoizedState;x.state=ne,mc(o,f,x,v),pc(),te=o.memoizedState,L||ne!==te||Rs?(typeof pe=="function"&&(Zm(o,c,pe,f),te=o.memoizedState),(K=Rs||O1(o,c,K,f,ne,te,E))?(de||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"&&(o.flags|=4194308)):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=te),x.props=f,x.state=te,x.context=E,f=K):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{x=o.stateNode,Tm(i,o),E=o.memoizedProps,de=Lo(c,E),x.props=de,pe=o.pendingProps,ne=x.context,te=c.contextType,K=Ml,typeof te=="object"&&te!==null&&(K=En(te)),L=c.getDerivedStateFromProps,(te=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==pe||ne!==K)&&L1(o,x,f,K),Rs=!1,ne=o.memoizedState,x.state=ne,mc(o,f,x,v),pc();var ae=o.memoizedState;E!==pe||ne!==ae||Rs||i!==null&&i.dependencies!==null&&kd(i.dependencies)?(typeof L=="function"&&(Zm(o,c,L,f),ae=o.memoizedState),(de=Rs||O1(o,c,de,f,ne,ae,K)||i!==null&&i.dependencies!==null&&kd(i.dependencies))?(te||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,ae,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,ae,K)),typeof x.componentDidUpdate=="function"&&(o.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=ae),x.props=f,x.state=ae,x.context=K,f=de):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),f=!1)}return x=f,Wd(i,o),f=(o.flags&128)!==0,x||f?(x=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:x.render(),o.flags|=1,i!==null&&f?(o.child=Do(o,i.child,null,v),o.child=Do(o,null,c,v)):Rn(i,o,c,v),o.memoizedState=x.state,i=o.child):i=qi(i,o,v),i}function Y1(i,o,c,f){return Eo(),o.flags|=256,Rn(i,o,c,f),o.child}var ng={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rg(i){return{baseLanes:i,cachePool:Bx()}}function ig(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=vr),i}function X1(i,o,c){var f=o.pendingProps,v=!1,x=(o.flags&128)!==0,E;if((E=x)||(E=i!==null&&i.memoizedState===null?!1:(Vt.current&2)!==0),E&&(v=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(it){if(v?Ns(o):As(),(i=Tt)?(i=iw(i,Lr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ws!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Mx(i),c.return=o,o.child=c,kn=o,Tt=null)):i=null,i===null)throw ks(o);return Hg(i)?o.lanes=32:o.lanes=536870912,null}var L=f.children;return f=f.fallback,v?(As(),v=o.mode,L=Vd({mode:"hidden",children:L},v),f=ko(f,v,c,null),L.return=o,f.return=o,L.sibling=f,o.child=L,f=o.child,f.memoizedState=rg(c),f.childLanes=ig(i,E,c),o.memoizedState=ng,bc(null,f)):(Ns(o),sg(o,L))}var K=i.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(x)o.flags&256?(Ns(o),o.flags&=-257,o=og(i,o,c)):o.memoizedState!==null?(As(),o.child=i.child,o.flags|=128,o=null):(As(),L=f.fallback,v=o.mode,f=Vd({mode:"visible",children:f.children},v),L=ko(L,v,c,null),L.flags|=2,f.return=o,L.return=o,f.sibling=L,o.child=f,Do(o,i.child,null,c),f=o.child,f.memoizedState=rg(c),f.childLanes=ig(i,E,c),o.memoizedState=ng,o=bc(null,f));else if(Ns(o),Hg(L)){if(E=L.nextSibling&&L.nextSibling.dataset,E)var te=E.dgst;E=te,f=Error(r(419)),f.stack="",f.digest=E,ac({value:f,source:null,stack:null}),o=og(i,o,c)}else if(Zt||Ol(i,o,c,!1),E=(c&i.childLanes)!==0,Zt||E){if(E=St,E!==null&&(f=Er(E,c),f!==0&&f!==K.retryLane))throw K.retryLane=f,Co(i,f),rr(E,i,f),eg;Ig(L)||eh(),o=og(i,o,c)}else Ig(L)?(o.flags|=192,o.child=i.child,o=null):(i=K.treeContext,Tt=zr(L.nextSibling),kn=o,it=!0,Cs=null,Lr=!1,i!==null&&Dx(o,i),o=sg(o,f.children),o.flags|=4096);return o}return v?(As(),L=f.fallback,v=o.mode,K=i.child,te=K.sibling,f=Hi(K,{mode:"hidden",children:f.children}),f.subtreeFlags=K.subtreeFlags&65011712,te!==null?L=Hi(te,L):(L=ko(L,v,c,null),L.flags|=2),L.return=o,f.return=o,f.sibling=L,o.child=f,bc(null,f),f=o.child,L=i.child.memoizedState,L===null?L=rg(c):(v=L.cachePool,v!==null?(K=Yt._currentValue,v=v.parent!==K?{parent:K,pool:K}:v):v=Bx(),L={baseLanes:L.baseLanes|c,cachePool:v}),f.memoizedState=L,f.childLanes=ig(i,E,c),o.memoizedState=ng,bc(i.child,f)):(Ns(o),c=i.child,i=c.sibling,c=Hi(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,i!==null&&(E=o.deletions,E===null?(o.deletions=[i],o.flags|=16):E.push(i)),o.child=c,o.memoizedState=null,c)}function sg(i,o){return o=Vd({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Vd(i,o){return i=fr(22,i,null,o),i.lanes=0,i}function og(i,o,c){return Do(o,i.child,null,c),i=sg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function Z1(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),xm(i.return,o,c)}function lg(i,o,c,f,v,x){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:v,treeForkCount:x}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=v,E.treeForkCount=x)}function Q1(i,o,c){var f=o.pendingProps,v=f.revealOrder,x=f.tail;f=f.children;var E=Vt.current,L=(E&2)!==0;if(L?(E=E&1|2,o.flags|=128):E&=1,A(Vt,E),Rn(i,o,f,c),f=it?lc:0,!L&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Z1(i,c,o);else if(i.tag===19)Z1(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&Od(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),lg(o,!1,v,c,x,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&Od(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}lg(o,!0,c,null,x,f);break;case"together":lg(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function qi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Ls|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(Ol(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=Hi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Hi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function ag(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&kd(i)))}function G3(i,o,c){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),Es(o,Yt,i.memoizedState.cache),Eo();break;case 27:case 5:ce(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:Es(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Om(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(Ns(o),o.flags|=128,null):(c&o.child.childLanes)!==0?X1(i,o,c):(Ns(o),i=qi(i,o,c),i!==null?i.sibling:null);Ns(o);break;case 19:var v=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(Ol(i,o,c,!1),f=(c&o.childLanes)!==0),v){if(f)return Q1(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),A(Vt,Vt.current),f)break;return null;case 22:return o.lanes=0,W1(i,o,c,o.pendingProps);case 24:Es(o,Yt,i.memoizedState.cache)}return qi(i,o,c)}function J1(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)Zt=!0;else{if(!ag(i,c)&&(o.flags&128)===0)return Zt=!1,G3(i,o,c);Zt=(i.flags&131072)!==0}else Zt=!1,it&&(o.flags&1048576)!==0&&Ax(o,lc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=No(o.elementType),o.type=i,typeof i=="function")fm(i)?(f=Lo(i,f),o.tag=1,o=G1(null,o,i,f,c)):(o.tag=0,o=tg(null,o,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===M){o.tag=11,o=F1(null,o,i,f,c);break e}else if(v===j){o.tag=14,o=U1(null,o,i,f,c);break e}}throw o=U(i)||i,Error(r(306,o,""))}}return o;case 0:return tg(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,v=Lo(f,o.pendingProps),G1(i,o,f,v,c);case 3:e:{if(ge(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var x=o.memoizedState;v=x.element,Tm(i,o),mc(o,f,null,c);var E=o.memoizedState;if(f=E.cache,Es(o,Yt,f),f!==x.cache&&Sm(o,[Yt],c,!0),pc(),f=E.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=Y1(i,o,f,c);break e}else if(f!==v){v=Ar(Error(r(424)),o),ac(v),o=Y1(i,o,f,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Tt=zr(i.firstChild),kn=o,it=!0,Cs=null,Lr=!0,c=Wx(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Eo(),f===v){o=qi(i,o,c);break e}Rn(i,o,f,c)}o=o.child}return o;case 26:return Wd(i,o),i===null?(c=uw(o.type,null,o.pendingProps,null))?o.memoizedState=c:it||(c=o.type,i=o.pendingProps,f=lh(se.current).createElement(c),f[Cn]=o,f[Zn]=i,Tn(f,c,i),fn(f),o.stateNode=f):o.memoizedState=uw(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return ce(o),i===null&&it&&(f=o.stateNode=lw(o.type,o.pendingProps,se.current),kn=o,Lr=!0,v=Tt,Is(o.type)?(Fg=v,Tt=zr(f.firstChild)):Tt=v),Rn(i,o,o.pendingProps.children,c),Wd(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&it&&((v=f=Tt)&&(f=CO(f,o.type,o.pendingProps,Lr),f!==null?(o.stateNode=f,kn=o,Tt=zr(f.firstChild),Lr=!1,v=!0):v=!1),v||ks(o)),ce(o),v=o.type,x=o.pendingProps,E=i!==null?i.memoizedProps:null,f=x.children,zg(v,x)?f=null:E!==null&&zg(v,E)&&(o.flags|=32),o.memoizedState!==null&&(v=jm(i,o,I3,null,null,c),jc._currentValue=v),Wd(i,o),Rn(i,o,f,c),o.child;case 6:return i===null&&it&&((i=c=Tt)&&(c=kO(c,o.pendingProps,Lr),c!==null?(o.stateNode=c,kn=o,Tt=null,i=!0):i=!1),i||ks(o)),null;case 13:return X1(i,o,c);case 4:return ge(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=Do(o,null,f,c):Rn(i,o,f,c),o.child;case 11:return F1(i,o,o.type,o.pendingProps,c);case 7:return Rn(i,o,o.pendingProps,c),o.child;case 8:return Rn(i,o,o.pendingProps.children,c),o.child;case 12:return Rn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,Es(o,o.type,f.value),Rn(i,o,f.children,c),o.child;case 9:return v=o.type._context,f=o.pendingProps.children,To(o),v=En(v),f=f(v),o.flags|=1,Rn(i,o,f,c),o.child;case 14:return U1(i,o,o.type,o.pendingProps,c);case 15:return $1(i,o,o.type,o.pendingProps,c);case 19:return Q1(i,o,c);case 31:return K3(i,o,c);case 22:return W1(i,o,c,o.pendingProps);case 24:return To(o),f=En(Yt),i===null?(v=km(),v===null&&(v=St,x=wm(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=c),v=x),o.memoizedState={parent:f,cache:v},Rm(o),Es(o,Yt,v)):((i.lanes&c)!==0&&(Tm(i,o),mc(o,null,null,c),pc()),v=i.memoizedState,x=o.memoizedState,v.parent!==f?(v={parent:f,cache:f},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Es(o,Yt,f)):(f=x.cache,Es(o,Yt,f),f!==v.cache&&Sm(o,[Yt],c,!0))),Rn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ki(i){i.flags|=4}function cg(i,o,c,f,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(ES())i.flags|=8192;else throw Ao=Md,Em}else i.flags&=-16777217}function eS(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!mw(o))if(ES())i.flags|=8192;else throw Ao=Md,Em}function qd(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Ye():536870912,i.lanes|=o,Vl|=o)}function xc(i,o){if(!it)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function Mt(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function Y3(i,o,c){var f=o.pendingProps;switch(vm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(o),null;case 1:return Mt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),$i(Yt),ie(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Dl(o)?Ki(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,ym())),Mt(o),null;case 26:var v=o.type,x=o.memoizedState;return i===null?(Ki(o),x!==null?(Mt(o),eS(o,x)):(Mt(o),cg(o,v,null,f,c))):x?x!==i.memoizedState?(Ki(o),Mt(o),eS(o,x)):(Mt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Ki(o),Mt(o),cg(o,v,i,f,c)),null;case 27:if(we(o),c=se.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}i=oe.current,Dl(o)?Ox(o):(i=lw(v,f,c),o.stateNode=i,Ki(o))}return Mt(o),null;case 5:if(we(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}if(x=oe.current,Dl(o))Ox(o);else{var E=lh(se.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?x.multiple=!0:f.size&&(x.size=f.size);break;default:x=typeof f.is=="string"?E.createElement(v,{is:f.is}):E.createElement(v)}}x[Cn]=o,x[Zn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=x;e:switch(Tn(x,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Ki(o)}}return Mt(o),cg(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=se.current,Dl(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,v=kn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[Cn]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||XS(i.nodeValue,c)),i||ks(o,!0)}else i=lh(i).createTextNode(f),i[Cn]=o,o.stateNode=i}return Mt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=Dl(o),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Cn]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),i=!1}else c=ym(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(mr(o),o):(mr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Mt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=Dl(o),f!==null&&f.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Cn]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),v=!1}else v=ym(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(mr(o),o):(mr(o),null)}return mr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==v&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),qd(o,o.updateQueue),Mt(o),null);case 4:return ie(),i===null&&Ag(o.stateNode.containerInfo),Mt(o),null;case 10:return $i(o.type),Mt(o),null;case 19:if(Y(Vt),f=o.memoizedState,f===null)return Mt(o),null;if(v=(o.flags&128)!==0,x=f.rendering,x===null)if(v)xc(f,!1);else{if(Ft!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(x=Od(i),x!==null){for(o.flags|=128,xc(f,!1),i=x.updateQueue,o.updateQueue=i,qd(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)Tx(c,i),c=c.sibling;return A(Vt,Vt.current&1|2),it&&Fi(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&le()>Zd&&(o.flags|=128,v=!0,xc(f,!1),o.lanes=4194304)}else{if(!v)if(i=Od(x),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,qd(o,i),xc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!it)return Mt(o),null}else 2*le()-f.renderingStartTime>Zd&&c!==536870912&&(o.flags|=128,v=!0,xc(f,!1),o.lanes=4194304);f.isBackwards?(x.sibling=o.child,o.child=x):(i=f.last,i!==null?i.sibling=x:o.child=x,f.last=x)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=le(),i.sibling=null,c=Vt.current,A(Vt,v?c&1|2:c&1),it&&Fi(o,f.treeForkCount),i):(Mt(o),null);case 22:case 23:return mr(o),Dm(),f=o.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(Mt(o),o.subtreeFlags&6&&(o.flags|=8192)):Mt(o),c=o.updateQueue,c!==null&&qd(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),i!==null&&Y(Mo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),$i(Yt),Mt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function X3(i,o){switch(vm(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return $i(Yt),ie(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return we(o),null;case 31:if(o.memoizedState!==null){if(mr(o),o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(mr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Eo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Y(Vt),null;case 4:return ie(),null;case 10:return $i(o.type),null;case 22:case 23:return mr(o),Dm(),i!==null&&Y(Mo),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return $i(Yt),null;case 25:return null;default:return null}}function tS(i,o){switch(vm(o),o.tag){case 3:$i(Yt),ie();break;case 26:case 27:case 5:we(o);break;case 4:ie();break;case 31:o.memoizedState!==null&&mr(o);break;case 13:mr(o);break;case 19:Y(Vt);break;case 10:$i(o.type);break;case 22:case 23:mr(o),Dm(),i!==null&&Y(Mo);break;case 24:$i(Yt)}}function Sc(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var v=f.next;c=v;do{if((c.tag&i)===i){f=void 0;var x=c.create,E=c.inst;f=x(),E.destroy=f}c=c.next}while(c!==v)}}catch(L){pt(o,o.return,L)}}function Ds(i,o,c){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var x=v.next;f=x;do{if((f.tag&i)===i){var E=f.inst,L=E.destroy;if(L!==void 0){E.destroy=void 0,v=o;var K=c,te=L;try{te()}catch(de){pt(v,K,de)}}}f=f.next}while(f!==x)}}catch(de){pt(o,o.return,de)}}function nS(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{qx(o,c)}catch(f){pt(i,i.return,f)}}}function rS(i,o,c){c.props=Lo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){pt(i,o,f)}}function wc(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(v){pt(i,o,v)}}function pi(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){pt(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){pt(i,o,v)}else c.current=null}function iS(i){var o=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(v){pt(i,i.return,v)}}function ug(i,o,c){try{var f=i.stateNode;_O(f,i.type,c,o),f[Zn]=o}catch(v){pt(i,i.return,v)}}function sS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Is(i.type)||i.tag===4}function dg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||sS(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&&Is(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 hg(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Bi));else if(f!==4&&(f===27&&Is(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(hg(i,o,c),i=i.sibling;i!==null;)hg(i,o,c),i=i.sibling}function Kd(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(f!==4&&(f===27&&Is(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Kd(i,o,c),i=i.sibling;i!==null;)Kd(i,o,c),i=i.sibling}function oS(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);Tn(o,f,c),o[Cn]=i,o[Zn]=c}catch(x){pt(i,i.return,x)}}var Gi=!1,Qt=!1,fg=!1,lS=typeof WeakSet=="function"?WeakSet:Set,pn=null;function Z3(i,o){if(i=i.containerInfo,Lg=ph,i=yx(i),om(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var v=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var E=0,L=-1,K=-1,te=0,de=0,pe=i,ne=null;t:for(;;){for(var ae;pe!==c||v!==0&&pe.nodeType!==3||(L=E+v),pe!==x||f!==0&&pe.nodeType!==3||(K=E+f),pe.nodeType===3&&(E+=pe.nodeValue.length),(ae=pe.firstChild)!==null;)ne=pe,pe=ae;for(;;){if(pe===i)break t;if(ne===c&&++te===v&&(L=E),ne===x&&++de===f&&(K=E),(ae=pe.nextSibling)!==null)break;pe=ne,ne=pe.parentNode}pe=ae}c=L===-1||K===-1?null:{start:L,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(jg={focusedElem:i,selectionRange:c},ph=!1,pn=o;pn!==null;)if(o=pn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,pn=i;else for(;pn!==null;){switch(o=pn,x=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=o,v=x.memoizedProps,x=x.memoizedState,f=c.stateNode;try{var Te=Lo(c.type,v);i=f.getSnapshotBeforeUpdate(Te,x),f.__reactInternalSnapshotBeforeUpdate=i}catch(Pe){pt(c,c.return,Pe)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Bg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bg(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=o.sibling,i!==null){i.return=o.return,pn=i;break}pn=o.return}}function aS(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Xi(i,c),f&4&&Sc(5,c);break;case 1:if(Xi(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){pt(c,c.return,E)}else{var v=Lo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){pt(c,c.return,E)}}f&64&&nS(c),f&512&&wc(c,c.return);break;case 3:if(Xi(i,c),f&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{qx(i,o)}catch(E){pt(c,c.return,E)}}break;case 27:o===null&&f&4&&oS(c);case 26:case 5:Xi(i,c),o===null&&f&4&&iS(c),f&512&&wc(c,c.return);break;case 12:Xi(i,c);break;case 31:Xi(i,c),f&4&&dS(i,c);break;case 13:Xi(i,c),f&4&&hS(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=oO.bind(null,c),EO(i,c))));break;case 22:if(f=c.memoizedState!==null||Gi,!f){o=o!==null&&o.memoizedState!==null||Qt,v=Gi;var x=Qt;Gi=f,(Qt=o)&&!x?Zi(i,c,(c.subtreeFlags&8772)!==0):Xi(i,c),Gi=v,Qt=x}break;case 30:break;default:Xi(i,c)}}function cS(i){var o=i.alternate;o!==null&&(i.alternate=null,cS(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&$p(o)),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 Ot=null,Jn=!1;function Yi(i,o,c){for(c=c.child;c!==null;)uS(i,o,c),c=c.sibling}function uS(i,o,c){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(nn,c)}catch{}switch(c.tag){case 26:Qt||pi(c,o),Yi(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Qt||pi(c,o);var f=Ot,v=Jn;Is(c.type)&&(Ot=c.stateNode,Jn=!1),Yi(i,o,c),Dc(c.stateNode),Ot=f,Jn=v;break;case 5:Qt||pi(c,o);case 6:if(f=Ot,v=Jn,Ot=null,Yi(i,o,c),Ot=f,Jn=v,Ot!==null)if(Jn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(c.stateNode)}catch(x){pt(c,o,x)}else try{Ot.removeChild(c.stateNode)}catch(x){pt(c,o,x)}break;case 18:Ot!==null&&(Jn?(i=Ot,nw(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Jl(i)):nw(Ot,c.stateNode));break;case 4:f=Ot,v=Jn,Ot=c.stateNode.containerInfo,Jn=!0,Yi(i,o,c),Ot=f,Jn=v;break;case 0:case 11:case 14:case 15:Ds(2,c,o),Qt||Ds(4,c,o),Yi(i,o,c);break;case 1:Qt||(pi(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&rS(c,o,f)),Yi(i,o,c);break;case 21:Yi(i,o,c);break;case 22:Qt=(f=Qt)||c.memoizedState!==null,Yi(i,o,c),Qt=f;break;default:Yi(i,o,c)}}function dS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Jl(i)}catch(c){pt(o,o.return,c)}}}function hS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Jl(i)}catch(c){pt(o,o.return,c)}}function Q3(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new lS),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new lS),o;default:throw Error(r(435,i.tag))}}function Gd(i,o){var c=Q3(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var v=lO.bind(null,i,f);f.then(v,v)}})}function er(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var v=c[f],x=i,E=o,L=E;e:for(;L!==null;){switch(L.tag){case 27:if(Is(L.type)){Ot=L.stateNode,Jn=!1;break e}break;case 5:Ot=L.stateNode,Jn=!1;break e;case 3:case 4:Ot=L.stateNode.containerInfo,Jn=!0;break e}L=L.return}if(Ot===null)throw Error(r(160));uS(x,E,v),Ot=null,Jn=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)fS(o,i),o=o.sibling}var Qr=null;function fS(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:er(o,i),tr(i),f&4&&(Ds(3,i,i.return),Sc(3,i),Ds(5,i,i.return));break;case 1:er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),f&64&&Gi&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var v=Qr;if(er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),f&4){var x=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":x=v.getElementsByTagName("title")[0],(!x||x[Xa]||x[Cn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(f),v.head.insertBefore(x,v.querySelector("head > title"))),Tn(x,f,c),x[Cn]=i,fn(x),f=x;break e;case"link":var E=fw("link","href",v).get(f+(c.href||""));if(E){for(var L=0;L<E.length;L++)if(x=E[L],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)){E.splice(L,1);break t}}x=v.createElement(f),Tn(x,f,c),v.head.appendChild(x);break;case"meta":if(E=fw("meta","content",v).get(f+(c.content||""))){for(L=0;L<E.length;L++)if(x=E[L],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)){E.splice(L,1);break t}}x=v.createElement(f),Tn(x,f,c),v.head.appendChild(x);break;default:throw Error(r(468,f))}x[Cn]=i,fn(x),f=x}i.stateNode=f}else pw(v,i.type,i.stateNode);else i.stateNode=hw(v,f,i.memoizedProps);else x!==f?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,f===null?pw(v,i.type,i.stateNode):hw(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&ug(i,i.memoizedProps,c.memoizedProps)}break;case 27:er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),c!==null&&f&4&&ug(i,i.memoizedProps,c.memoizedProps);break;case 5:if(er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),i.flags&32){v=i.stateNode;try{Sl(v,"")}catch(Te){pt(i,i.return,Te)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,ug(i,v,c!==null?c.memoizedProps:v)),f&1024&&(fg=!0);break;case 6:if(er(o,i),tr(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(Te){pt(i,i.return,Te)}}break;case 3:if(uh=null,v=Qr,Qr=ah(o.containerInfo),er(o,i),Qr=v,tr(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Jl(o.containerInfo)}catch(Te){pt(i,i.return,Te)}fg&&(fg=!1,pS(i));break;case 4:f=Qr,Qr=ah(i.stateNode.containerInfo),er(o,i),tr(i),Qr=f;break;case 12:er(o,i),tr(i);break;case 31:er(o,i),tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 13:er(o,i),tr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Xd=le()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 22:v=i.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,te=Gi,de=Qt;if(Gi=te||v,Qt=de||K,er(o,i),Qt=de,Gi=te,tr(i),f&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||K||Gi||Qt||jo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){K=c=o;try{if(x=K.stateNode,v)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{L=K.stateNode;var pe=K.memoizedProps.style,ne=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;L.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Te){pt(K,K.return,Te)}}}else if(o.tag===6){if(c===null){K=o;try{K.stateNode.nodeValue=v?"":K.memoizedProps}catch(Te){pt(K,K.return,Te)}}}else if(o.tag===18){if(c===null){K=o;try{var ae=K.stateNode;v?rw(ae,!0):rw(K.stateNode,!1)}catch(Te){pt(K,K.return,Te)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,Gd(i,c))));break;case 19:er(o,i),tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 30:break;case 21:break;default:er(o,i),tr(i)}}function tr(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(sS(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,x=dg(i);Kd(i,x,v);break;case 5:var E=c.stateNode;c.flags&32&&(Sl(E,""),c.flags&=-33);var L=dg(i);Kd(i,L,E);break;case 3:case 4:var K=c.stateNode.containerInfo,te=dg(i);hg(i,te,K);break;default:throw Error(r(161))}}catch(de){pt(i,i.return,de)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function pS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;pS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function Xi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)aS(i,o.alternate,o),o=o.sibling}function jo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Ds(4,o,o.return),jo(o);break;case 1:pi(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&rS(o,o.return,c),jo(o);break;case 27:Dc(o.stateNode);case 26:case 5:pi(o,o.return),jo(o);break;case 22:o.memoizedState===null&&jo(o);break;case 30:jo(o);break;default:jo(o)}i=i.sibling}}function Zi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,v=i,x=o,E=x.flags;switch(x.tag){case 0:case 11:case 15:Zi(v,x,c),Sc(4,x);break;case 1:if(Zi(v,x,c),f=x,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){pt(f,f.return,te)}if(f=x,v=f.updateQueue,v!==null){var L=f.stateNode;try{var K=v.shared.hiddenCallbacks;if(K!==null)for(v.shared.hiddenCallbacks=null,v=0;v<K.length;v++)Vx(K[v],L)}catch(te){pt(f,f.return,te)}}c&&E&64&&nS(x),wc(x,x.return);break;case 27:oS(x);case 26:case 5:Zi(v,x,c),c&&f===null&&E&4&&iS(x),wc(x,x.return);break;case 12:Zi(v,x,c);break;case 31:Zi(v,x,c),c&&E&4&&dS(v,x);break;case 13:Zi(v,x,c),c&&E&4&&hS(v,x);break;case 22:x.memoizedState===null&&Zi(v,x,c),wc(x,x.return);break;case 30:break;default:Zi(v,x,c)}o=o.sibling}}function pg(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&cc(c))}function mg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&cc(i))}function Jr(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)mS(i,o,c,f),o=o.sibling}function mS(i,o,c,f){var v=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(i,o,c,f),v&2048&&Sc(9,o);break;case 1:Jr(i,o,c,f);break;case 3:Jr(i,o,c,f),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&cc(i)));break;case 12:if(v&2048){Jr(i,o,c,f),i=o.stateNode;try{var x=o.memoizedProps,E=x.id,L=x.onPostCommit;typeof L=="function"&&L(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(K){pt(o,o.return,K)}}else Jr(i,o,c,f);break;case 31:Jr(i,o,c,f);break;case 13:Jr(i,o,c,f);break;case 23:break;case 22:x=o.stateNode,E=o.alternate,o.memoizedState!==null?x._visibility&2?Jr(i,o,c,f):Cc(i,o):x._visibility&2?Jr(i,o,c,f):(x._visibility|=2,Ul(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),v&2048&&pg(E,o);break;case 24:Jr(i,o,c,f),v&2048&&mg(o.alternate,o);break;default:Jr(i,o,c,f)}}function Ul(i,o,c,f,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var x=i,E=o,L=c,K=f,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ul(x,E,L,K,v),Sc(8,E);break;case 23:break;case 22:var de=E.stateNode;E.memoizedState!==null?de._visibility&2?Ul(x,E,L,K,v):Cc(x,E):(de._visibility|=2,Ul(x,E,L,K,v)),v&&te&2048&&pg(E.alternate,E);break;case 24:Ul(x,E,L,K,v),v&&te&2048&&mg(E.alternate,E);break;default:Ul(x,E,L,K,v)}o=o.sibling}}function Cc(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,v=f.flags;switch(f.tag){case 22:Cc(c,f),v&2048&&pg(f.alternate,f);break;case 24:Cc(c,f),v&2048&&mg(f.alternate,f);break;default:Cc(c,f)}o=o.sibling}}var kc=8192;function $l(i,o,c){if(i.subtreeFlags&kc)for(i=i.child;i!==null;)gS(i,o,c),i=i.sibling}function gS(i,o,c){switch(i.tag){case 26:$l(i,o,c),i.flags&kc&&i.memoizedState!==null&&BO(c,Qr,i.memoizedState,i.memoizedProps);break;case 5:$l(i,o,c);break;case 3:case 4:var f=Qr;Qr=ah(i.stateNode.containerInfo),$l(i,o,c),Qr=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=kc,kc=16777216,$l(i,o,c),kc=f):$l(i,o,c));break;default:$l(i,o,c)}}function vS(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Ec(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];pn=f,yS(f,i)}vS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)_S(i),i=i.sibling}function _S(i){switch(i.tag){case 0:case 11:case 15:Ec(i),i.flags&2048&&Ds(9,i,i.return);break;case 3:Ec(i);break;case 12:Ec(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Yd(i)):Ec(i);break;default:Ec(i)}}function Yd(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];pn=f,yS(f,i)}vS(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ds(8,o,o.return),Yd(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Yd(o));break;default:Yd(o)}i=i.sibling}}function yS(i,o){for(;pn!==null;){var c=pn;switch(c.tag){case 0:case 11:case 15:Ds(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:cc(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,pn=f;else e:for(c=i;pn!==null;){f=pn;var v=f.sibling,x=f.return;if(cS(f),f===c){pn=null;break e}if(v!==null){v.return=x,pn=v;break e}pn=x}}}var J3={getCacheForType:function(i){var o=En(Yt),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return En(Yt).controller.signal}},eO=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Ze=null,tt=0,ft=0,gr=null,Os=!1,Wl=!1,gg=!1,Qi=0,Ft=0,Ls=0,zo=0,vg=0,vr=0,Vl=0,Rc=null,nr=null,_g=!1,Xd=0,bS=0,Zd=1/0,Qd=null,js=null,sn=0,zs=null,ql=null,Ji=0,yg=0,bg=null,xS=null,Tc=0,xg=null;function _r(){return(ut&2)!==0&&tt!==0?tt&-tt:B.T!==null?Rg():Xr()}function SS(){if(vr===0)if((tt&536870912)===0||it){var i=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),vr=i}else vr=536870912;return i=pr.current,i!==null&&(i.flags|=32),vr}function rr(i,o,c){(i===St&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Kl(i,0),Ps(i,tt,vr,!1)),ur(i,c),((ut&2)===0||i!==St)&&(i===St&&((ut&2)===0&&(zo|=c),Ft===4&&Ps(i,tt,vr,!1)),mi(i))}function wS(i,o,c){if((ut&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||_e(i,o),v=f?rO(i,o):wg(i,o,!0),x=f;do{if(v===0){Wl&&!f&&Ps(i,o,0,!1);break}else{if(c=i.current.alternate,x&&!tO(c)){v=wg(i,o,!1),x=!1;continue}if(v===2){if(x=o,i.errorRecoveryDisabledLanes&x)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var L=i;v=Rc;var K=L.current.memoizedState.isDehydrated;if(K&&(Kl(L,E).flags|=256),E=wg(L,E,!1),E!==2){if(gg&&!K){L.errorRecoveryDisabledLanes|=x,zo|=x,v=4;break e}x=nr,nr=v,x!==null&&(nr===null?nr=x:nr.push.apply(nr,x))}v=E}if(x=!1,v!==2)continue}}if(v===1){Kl(i,0),Ps(i,o,0,!0);break}e:{switch(f=i,x=v,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Ps(f,o,vr,!Os);break e;case 2:nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Xd+300-le(),10<v)){if(Ps(f,o,vr,!Os),re(f,0,!0)!==0)break e;Ji=o,f.timeoutHandle=ew(CS.bind(null,f,c,nr,Qd,_g,o,vr,zo,Vl,Os,x,"Throttled",-0,0),v);break e}CS(f,c,nr,Qd,_g,o,vr,zo,Vl,Os,x,null,-0,0)}}break}while(!0);mi(i)}function CS(i,o,c,f,v,x,E,L,K,te,de,pe,ne,ae){if(i.timeoutHandle=-1,pe=o.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bi},gS(o,x,pe);var Te=(x&62914560)===x?Xd-le():(x&4194048)===x?bS-le():0;if(Te=IO(pe,Te),Te!==null){Ji=x,i.cancelPendingCommit=Te(DS.bind(null,i,o,x,c,f,v,E,L,K,de,pe,null,ne,ae)),Ps(i,x,E,!te);return}}DS(i,o,x,c,f,v,E,L,K)}function tO(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var v=c[f],x=v.getSnapshot;v=v.value;try{if(!hr(x(),v))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ps(i,o,c,f){o&=~vg,o&=~zo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var v=o;0<v;){var x=31-ot(v),E=1<<x;f[x]=-1,v&=~E}c!==0&&Yr(i,c,o)}function Jd(){return(ut&6)===0?(Mc(0),!1):!0}function Sg(){if(Ze!==null){if(ft===0)var i=Ze.return;else i=Ze,Ui=Ro=null,Bm(i),Pl=null,dc=0,i=Ze;for(;i!==null;)tS(i.alternate,i),i=i.return;Ze=null}}function Kl(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,xO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Ji=0,Sg(),St=i,Ze=c=Hi(i.current,null),tt=o,ft=0,gr=null,Os=!1,Wl=_e(i,o),gg=!1,Vl=vr=vg=zo=Ls=Ft=0,nr=Rc=null,_g=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var v=31-ot(f),x=1<<v;o|=i[v],f&=~x}return Qi=o,bd(),c}function kS(i,o){$e=null,B.H=yc,o===zl||o===Td?(o=Fx(),ft=3):o===Em?(o=Fx(),ft=4):ft=o===eg?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,gr=o,Ze===null&&(Ft=1,Ud(i,Ar(o,i.current)))}function ES(){var i=pr.current;return i===null?!0:(tt&4194048)===tt?jr===null:(tt&62914560)===tt||(tt&536870912)!==0?i===jr:!1}function RS(){var i=B.H;return B.H=yc,i===null?yc:i}function TS(){var i=B.A;return B.A=J3,i}function eh(){Ft=4,Os||(tt&4194048)!==tt&&pr.current!==null||(Wl=!0),(Ls&134217727)===0&&(zo&134217727)===0||St===null||Ps(St,tt,vr,!1)}function wg(i,o,c){var f=ut;ut|=2;var v=RS(),x=TS();(St!==i||tt!==o)&&(Qd=null,Kl(i,o)),o=!1;var E=Ft;e:do try{if(ft!==0&&Ze!==null){var L=Ze,K=gr;switch(ft){case 8:Sg(),E=6;break e;case 3:case 2:case 9:case 6:pr.current===null&&(o=!0);var te=ft;if(ft=0,gr=null,Gl(i,L,K,te),c&&Wl){E=0;break e}break;default:te=ft,ft=0,gr=null,Gl(i,L,K,te)}}nO(),E=Ft;break}catch(de){kS(i,de)}while(!0);return o&&i.shellSuspendCounter++,Ui=Ro=null,ut=f,B.H=v,B.A=x,Ze===null&&(St=null,tt=0,bd()),E}function nO(){for(;Ze!==null;)MS(Ze)}function rO(i,o){var c=ut;ut|=2;var f=RS(),v=TS();St!==i||tt!==o?(Qd=null,Zd=le()+500,Kl(i,o)):Wl=_e(i,o);e:do try{if(ft!==0&&Ze!==null){o=Ze;var x=gr;t:switch(ft){case 1:ft=0,gr=null,Gl(i,o,x,1);break;case 2:case 9:if(Ix(x)){ft=0,gr=null,NS(o);break}o=function(){ft!==2&&ft!==9||St!==i||(ft=7),mi(i)},x.then(o,o);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Ix(x)?(ft=0,gr=null,NS(o)):(ft=0,gr=null,Gl(i,o,x,7));break;case 5:var E=null;switch(Ze.tag){case 26:E=Ze.memoizedState;case 5:case 27:var L=Ze;if(E?mw(E):L.stateNode.complete){ft=0,gr=null;var K=L.sibling;if(K!==null)Ze=K;else{var te=L.return;te!==null?(Ze=te,th(te)):Ze=null}break t}}ft=0,gr=null,Gl(i,o,x,5);break;case 6:ft=0,gr=null,Gl(i,o,x,6);break;case 8:Sg(),Ft=6;break e;default:throw Error(r(462))}}iO();break}catch(de){kS(i,de)}while(!0);return Ui=Ro=null,B.H=f,B.A=v,ut=c,Ze!==null?0:(St=null,tt=0,bd(),Ft)}function iO(){for(;Ze!==null&&!cr();)MS(Ze)}function MS(i){var o=J1(i.alternate,i,Qi);i.memoizedProps=i.pendingProps,o===null?th(i):Ze=o}function NS(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=K1(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=K1(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Bm(o);default:tS(c,o),o=Ze=Tx(o,Qi),o=J1(c,o,Qi)}i.memoizedProps=i.pendingProps,o===null?th(i):Ze=o}function Gl(i,o,c,f){Ui=Ro=null,Bm(o),Pl=null,dc=0;var v=o.return;try{if(q3(i,v,o,c,tt)){Ft=1,Ud(i,Ar(c,i.current)),Ze=null;return}}catch(x){if(v!==null)throw Ze=v,x;Ft=1,Ud(i,Ar(c,i.current)),Ze=null;return}o.flags&32768?(it||f===1?i=!0:Wl||(tt&536870912)!==0?i=!1:(Os=i=!0,(f===2||f===9||f===3||f===6)&&(f=pr.current,f!==null&&f.tag===13&&(f.flags|=16384))),AS(o,i)):th(o)}function th(i){var o=i;do{if((o.flags&32768)!==0){AS(o,Os);return}i=o.return;var c=Y3(o.alternate,o,Qi);if(c!==null){Ze=c;return}if(o=o.sibling,o!==null){Ze=o;return}Ze=o=i}while(o!==null);Ft===0&&(Ft=5)}function AS(i,o){do{var c=X3(i.alternate,i);if(c!==null){c.flags&=32767,Ze=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Ze=i;return}Ze=i=c}while(i!==null);Ft=6,Ze=null}function DS(i,o,c,f,v,x,E,L,K){i.cancelPendingCommit=null;do nh();while(sn!==0);if((ut&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(x=o.lanes|o.childLanes,x|=dm,rn(i,c,x,E,L,K),i===St&&(Ze=St=null,tt=0),ql=o,zs=i,Ji=c,yg=x,bg=v,xS=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,aO(Le,function(){return PS(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=B.T,B.T=null,v=q.p,q.p=2,E=ut,ut|=4;try{Z3(i,o,c)}finally{ut=E,q.p=v,B.T=f}}sn=1,OS(),LS(),jS()}}function OS(){if(sn===1){sn=0;var i=zs,o=ql,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=B.T,B.T=null;var f=q.p;q.p=2;var v=ut;ut|=4;try{fS(o,i);var x=jg,E=yx(i.containerInfo),L=x.focusedElem,K=x.selectionRange;if(E!==L&&L&&L.ownerDocument&&_x(L.ownerDocument.documentElement,L)){if(K!==null&&om(L)){var te=K.start,de=K.end;if(de===void 0&&(de=te),"selectionStart"in L)L.selectionStart=te,L.selectionEnd=Math.min(de,L.value.length);else{var pe=L.ownerDocument||document,ne=pe&&pe.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),Te=L.textContent.length,Pe=Math.min(K.start,Te),vt=K.end===void 0?Pe:Math.min(K.end,Te);!ae.extend&&Pe>vt&&(E=vt,vt=Pe,Pe=E);var Q=vx(L,Pe),X=vx(L,vt);if(Q&&X&&(ae.rangeCount!==1||ae.anchorNode!==Q.node||ae.anchorOffset!==Q.offset||ae.focusNode!==X.node||ae.focusOffset!==X.offset)){var ee=pe.createRange();ee.setStart(Q.node,Q.offset),ae.removeAllRanges(),Pe>vt?(ae.addRange(ee),ae.extend(X.node,X.offset)):(ee.setEnd(X.node,X.offset),ae.addRange(ee))}}}}for(pe=[],ae=L;ae=ae.parentNode;)ae.nodeType===1&&pe.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<pe.length;L++){var he=pe[L];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}ph=!!Lg,jg=Lg=null}finally{ut=v,q.p=f,B.T=c}}i.current=o,sn=2}}function LS(){if(sn===2){sn=0;var i=zs,o=ql,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=B.T,B.T=null;var f=q.p;q.p=2;var v=ut;ut|=4;try{aS(i,o.alternate,o)}finally{ut=v,q.p=f,B.T=c}}sn=3}}function jS(){if(sn===4||sn===3){sn=0,Gr();var i=zs,o=ql,c=Ji,f=xS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?sn=5:(sn=0,ql=zs=null,zS(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(js=null),zi(c),o=o.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(nn,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=B.T,v=q.p,q.p=2,B.T=null;try{for(var x=i.onRecoverableError,E=0;E<f.length;E++){var L=f[E];x(L.value,{componentStack:L.stack})}}finally{B.T=o,q.p=v}}(Ji&3)!==0&&nh(),mi(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===xg?Tc++:(Tc=0,xg=i):Tc=0,Mc(0)}}function zS(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,cc(o)))}function nh(){return OS(),LS(),jS(),PS()}function PS(){if(sn!==5)return!1;var i=zs,o=yg;yg=0;var c=zi(Ji),f=B.T,v=q.p;try{q.p=32>c?32:c,B.T=null,c=bg,bg=null;var x=zs,E=Ji;if(sn=0,ql=zs=null,Ji=0,(ut&6)!==0)throw Error(r(331));var L=ut;if(ut|=4,_S(x.current),mS(x,x.current,E,c),ut=L,Mc(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(nn,x)}catch{}return!0}finally{q.p=v,B.T=f,zS(i,o)}}function BS(i,o,c){o=Ar(c,o),o=Jm(i.stateNode,o,2),i=Ms(i,o,2),i!==null&&(ur(i,2),mi(i))}function pt(i,o,c){if(i.tag===3)BS(i,i,c);else for(;o!==null;){if(o.tag===3){BS(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(js===null||!js.has(f))){i=Ar(c,i),c=I1(2),f=Ms(o,c,2),f!==null&&(H1(c,f,o,i),ur(f,2),mi(f));break}}o=o.return}}function Cg(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new eO;var v=new Set;f.set(o,v)}else v=f.get(o),v===void 0&&(v=new Set,f.set(o,v));v.has(c)||(gg=!0,v.add(c),i=sO.bind(null,i,o,c),o.then(i,i))}function sO(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,St===i&&(tt&c)===c&&(Ft===4||Ft===3&&(tt&62914560)===tt&&300>le()-Xd?(ut&2)===0&&Kl(i,0):vg|=c,Vl===tt&&(Vl=0)),mi(i)}function IS(i,o){o===0&&(o=Ye()),i=Co(i,o),i!==null&&(ur(i,o),mi(i))}function oO(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),IS(i,c)}function lO(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,v=i.memoizedState;v!==null&&(c=v.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(o),IS(i,c)}function aO(i,o){return zt(i,o)}var rh=null,Yl=null,kg=!1,ih=!1,Eg=!1,Bs=0;function mi(i){i!==Yl&&i.next===null&&(Yl===null?rh=Yl=i:Yl=Yl.next=i),ih=!0,kg||(kg=!0,uO())}function Mc(i,o){if(!Eg&&ih){Eg=!0;do for(var c=!1,f=rh;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var x=0;else{var E=f.suspendedLanes,L=f.pingedLanes;x=(1<<31-ot(42|i)+1)-1,x&=v&~(E&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,$S(f,x))}else x=tt,x=re(f,f===St?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||_e(f,x)||(c=!0,$S(f,x));f=f.next}while(c);Eg=!1}}function cO(){HS()}function HS(){ih=kg=!1;var i=0;Bs!==0&&bO()&&(i=Bs);for(var o=le(),c=null,f=rh;f!==null;){var v=f.next,x=FS(f,o);x===0?(f.next=null,c===null?rh=v:c.next=v,v===null&&(Yl=c)):(c=f,(i!==0||(x&3)!==0)&&(ih=!0)),f=v}sn!==0&&sn!==5||Mc(i),Bs!==0&&(Bs=0)}function FS(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var E=31-ot(x),L=1<<E,K=v[E];K===-1?((L&c)===0||(L&f)!==0)&&(v[E]=Ue(L,o)):K<=o&&(i.expiredLanes|=L),x&=~L}if(o=St,c=tt,c=re(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&In(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||_e(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&In(f),zi(c)){case 2:case 8:c=ve;break;case 32:c=Le;break;case 268435456:c=Xe;break;default:c=Le}return f=US.bind(null,i),c=zt(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&In(f),i.callbackPriority=2,i.callbackNode=null,2}function US(i,o){if(sn!==0&&sn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(nh()&&i.callbackNode!==c)return null;var f=tt;return f=re(i,i===St?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(wS(i,f,o),FS(i,le()),i.callbackNode!=null&&i.callbackNode===c?US.bind(null,i):null)}function $S(i,o){if(nh())return null;wS(i,o,!0)}function uO(){SO(function(){(ut&6)!==0?zt(ue,cO):HS()})}function Rg(){if(Bs===0){var i=Ll;i===0&&(i=bs,bs<<=1,(bs&261888)===0&&(bs=256)),Bs=i}return Bs}function WS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:hd(""+i)}function VS(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function dO(i,o,c,f,v){if(o==="submit"&&c&&c.stateNode===v){var x=WS((v[Zn]||null).action),E=f.submitter;E&&(o=(o=E[Zn]||null)?WS(o.formAction):E.getAttribute("formAction"),o!==null&&(x=o,E=null));var L=new gd("action","action",null,f,v);i.push({event:L,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Bs!==0){var K=E?VS(v,E):new FormData(v);Km(c,{pending:!0,data:K,method:v.method,action:x},null,K)}}else typeof x=="function"&&(L.preventDefault(),K=E?VS(v,E):new FormData(v),Km(c,{pending:!0,data:K,method:v.method,action:x},x,K))},currentTarget:v}]})}}for(var Tg=0;Tg<um.length;Tg++){var Mg=um[Tg],hO=Mg.toLowerCase(),fO=Mg[0].toUpperCase()+Mg.slice(1);Zr(hO,"on"+fO)}Zr(Sx,"onAnimationEnd"),Zr(wx,"onAnimationIteration"),Zr(Cx,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(M3,"onTransitionRun"),Zr(N3,"onTransitionStart"),Zr(A3,"onTransitionCancel"),Zr(kx,"onTransitionEnd"),bl("onMouseEnter",["mouseout","mouseover"]),bl("onMouseLeave",["mouseout","mouseover"]),bl("onPointerEnter",["pointerout","pointerover"]),bl("onPointerLeave",["pointerout","pointerover"]),bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bo("onBeforeInput",["compositionend","keypress","textInput","paste"]),bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),pO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function qS(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],v=f.event;f=f.listeners;e:{var x=void 0;if(o)for(var E=f.length-1;0<=E;E--){var L=f[E],K=L.instance,te=L.currentTarget;if(L=L.listener,K!==x&&v.isPropagationStopped())break e;x=L,v.currentTarget=te;try{x(v)}catch(de){yd(de)}v.currentTarget=null,x=K}else for(E=0;E<f.length;E++){if(L=f[E],K=L.instance,te=L.currentTarget,L=L.listener,K!==x&&v.isPropagationStopped())break e;x=L,v.currentTarget=te;try{x(v)}catch(de){yd(de)}v.currentTarget=null,x=K}}}}function Qe(i,o){var c=o[Up];c===void 0&&(c=o[Up]=new Set);var f=i+"__bubble";c.has(f)||(KS(o,i,2,!1),c.add(f))}function Ng(i,o,c){var f=0;o&&(f|=4),KS(c,i,f,o)}var sh="_reactListening"+Math.random().toString(36).slice(2);function Ag(i){if(!i[sh]){i[sh]=!0,H0.forEach(function(c){c!=="selectionchange"&&(pO.has(c)||Ng(c,!1,i),Ng(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[sh]||(o[sh]=!0,Ng("selectionchange",!1,o))}}function KS(i,o,c,f){switch(Sw(o)){case 2:var v=UO;break;case 8:v=$O;break;default:v=qg}c=v.bind(null,o,c,i),v=void 0,!Zp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),f?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function Dg(i,o,c,f,v){var x=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var L=f.stateNode.containerInfo;if(L===v)break;if(E===4)for(E=f.return;E!==null;){var K=E.tag;if((K===3||K===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;L!==null;){if(E=vl(L),E===null)return;if(K=E.tag,K===5||K===6||K===26||K===27){f=x=E;continue e}L=L.parentNode}}f=f.return}Q0(function(){var te=x,de=Yp(c),pe=[];e:{var ne=Ex.get(i);if(ne!==void 0){var ae=gd,Te=i;switch(i){case"keypress":if(pd(c)===0)break e;case"keydown":case"keyup":ae=l3;break;case"focusin":Te="focus",ae=tm;break;case"focusout":Te="blur",ae=tm;break;case"beforeblur":case"afterblur":ae=tm;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":ae=tx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=YD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=u3;break;case Sx:case wx:case Cx:ae=QD;break;case kx:ae=h3;break;case"scroll":case"scrollend":ae=KD;break;case"wheel":ae=p3;break;case"copy":case"cut":case"paste":ae=e3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=rx;break;case"toggle":case"beforetoggle":ae=g3}var Pe=(o&4)!==0,vt=!Pe&&(i==="scroll"||i==="scrollend"),Q=Pe?ne!==null?ne+"Capture":null:ne;Pe=[];for(var X=te,ee;X!==null;){var he=X;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||Q===null||(he=Qa(X,Q),he!=null&&Pe.push(Ac(X,he,ee))),vt)break;X=X.return}0<Pe.length&&(ne=new ae(ne,Te,null,c,de),pe.push({event:ne,listeners:Pe}))}}if((o&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",ae=i==="mouseout"||i==="pointerout",ne&&c!==Gp&&(Te=c.relatedTarget||c.fromElement)&&(vl(Te)||Te[gl]))break e;if((ae||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(Te=c.relatedTarget||c.toElement,ae=te,Te=Te?vl(Te):null,Te!==null&&(vt=l(Te),Pe=Te.tag,Te!==vt||Pe!==5&&Pe!==27&&Pe!==6)&&(Te=null)):(ae=null,Te=te),ae!==Te)){if(Pe=tx,he="onMouseLeave",Q="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(Pe=rx,he="onPointerLeave",Q="onPointerEnter",X="pointer"),vt=ae==null?ne:Za(ae),ee=Te==null?ne:Za(Te),ne=new Pe(he,X+"leave",ae,c,de),ne.target=vt,ne.relatedTarget=ee,he=null,vl(de)===te&&(Pe=new Pe(Q,X+"enter",Te,c,de),Pe.target=ee,Pe.relatedTarget=vt,he=Pe),vt=he,ae&&Te)t:{for(Pe=mO,Q=ae,X=Te,ee=0,he=Q;he;he=Pe(he))ee++;he=0;for(var je=X;je;je=Pe(je))he++;for(;0<ee-he;)Q=Pe(Q),ee--;for(;0<he-ee;)X=Pe(X),he--;for(;ee--;){if(Q===X||X!==null&&Q===X.alternate){Pe=Q;break t}Q=Pe(Q),X=Pe(X)}Pe=null}else Pe=null;ae!==null&&GS(pe,ne,ae,Pe,!1),Te!==null&&vt!==null&&GS(pe,vt,Te,Pe,!0)}}e:{if(ne=te?Za(te):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var at=dx;else if(cx(ne))if(hx)at=E3;else{at=C3;var De=w3}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Kp(te.elementType)&&(at=dx):at=k3;if(at&&(at=at(i,te))){ux(pe,at,c,de);break e}De&&De(i,ne,te),i==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&qp(ne,"number",ne.value)}switch(De=te?Za(te):window,i){case"focusin":(cx(De)||De.contentEditable==="true")&&(El=De,lm=te,oc=null);break;case"focusout":oc=lm=El=null;break;case"mousedown":am=!0;break;case"contextmenu":case"mouseup":case"dragend":am=!1,bx(pe,c,de);break;case"selectionchange":if(T3)break;case"keydown":case"keyup":bx(pe,c,de)}var We;if(rm)e:{switch(i){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else kl?lx(i,c)&&(nt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(ix&&c.locale!=="ko"&&(kl||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&kl&&(We=J0()):(Ss=de,Qp="value"in Ss?Ss.value:Ss.textContent,kl=!0)),De=oh(te,nt),0<De.length&&(nt=new nx(nt,i,null,c,de),pe.push({event:nt,listeners:De}),We?nt.data=We:(We=ax(c),We!==null&&(nt.data=We)))),(We=_3?y3(i,c):b3(i,c))&&(nt=oh(te,"onBeforeInput"),0<nt.length&&(De=new nx("onBeforeInput","beforeinput",null,c,de),pe.push({event:De,listeners:nt}),De.data=We)),dO(pe,i,te,c,de)}qS(pe,o)})}function Ac(i,o,c){return{instance:i,listener:o,currentTarget:c}}function oh(i,o){for(var c=o+"Capture",f=[];i!==null;){var v=i,x=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||x===null||(v=Qa(i,c),v!=null&&f.unshift(Ac(i,v,x)),v=Qa(i,o),v!=null&&f.push(Ac(i,v,x))),i.tag===3)return f;i=i.return}return[]}function mO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function GS(i,o,c,f,v){for(var x=o._reactName,E=[];c!==null&&c!==f;){var L=c,K=L.alternate,te=L.stateNode;if(L=L.tag,K!==null&&K===f)break;L!==5&&L!==26&&L!==27||te===null||(K=te,v?(te=Qa(c,x),te!=null&&E.unshift(Ac(c,te,K))):v||(te=Qa(c,x),te!=null&&E.push(Ac(c,te,K)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var gO=/\r\n?/g,vO=/\u0000|\uFFFD/g;function YS(i){return(typeof i=="string"?i:""+i).replace(gO,`
|
|
49
|
+
`).replace(vO,"")}function XS(i,o){return o=YS(o),YS(i)===o}function gt(i,o,c,f,v,x){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||Sl(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&Sl(i,""+f);break;case"className":ud(i,"class",f);break;case"tabIndex":ud(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":ud(i,c,f);break;case"style":X0(i,f,x);break;case"data":if(o!=="object"){ud(i,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=hd(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="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"?(o!=="input"&>(i,o,"name",v.name,v,null),gt(i,o,"formEncType",v.formEncType,v,null),gt(i,o,"formMethod",v.formMethod,v,null),gt(i,o,"formTarget",v.formTarget,v,null)):(gt(i,o,"encType",v.encType,v,null),gt(i,o,"method",v.method,v,null),gt(i,o,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=hd(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Bi);break;case"onScroll":f!=null&&Qe("scroll",i);break;case"onScrollEnd":f!=null&&Qe("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=hd(""+f),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":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":Qe("beforetoggle",i),Qe("toggle",i),cd(i,"popover",f);break;case"xlinkActuate":Pi(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Pi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Pi(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Pi(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Pi(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Pi(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":cd(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=VD.get(c)||c,cd(i,c,f))}}function Og(i,o,c,f,v,x){switch(c){case"style":X0(i,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?Sl(i,f):(typeof f=="number"||typeof f=="bigint")&&Sl(i,""+f);break;case"onScroll":f!=null&&Qe("scroll",i);break;case"onScrollEnd":f!=null&&Qe("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!F0.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),x=i[Zn]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(o,x,v),typeof f=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,v);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):cd(i,c,f)}}}function Tn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var f=!1,v=!1,x;for(x in c)if(c.hasOwnProperty(x)){var E=c[x];if(E!=null)switch(x){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:gt(i,o,x,E,c,null)}}v&>(i,o,"srcSet",c.srcSet,c,null),f&>(i,o,"src",c.src,c,null);return;case"input":Qe("invalid",i);var L=x=E=v=null,K=null,te=null;for(f in c)if(c.hasOwnProperty(f)){var de=c[f];if(de!=null)switch(f){case"name":v=de;break;case"type":E=de;break;case"checked":K=de;break;case"defaultChecked":te=de;break;case"value":x=de;break;case"defaultValue":L=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,o));break;default:gt(i,o,f,de,c,null)}}q0(i,x,L,K,te,E,v,!1);return;case"select":Qe("invalid",i),f=E=x=null;for(v in c)if(c.hasOwnProperty(v)&&(L=c[v],L!=null))switch(v){case"value":x=L;break;case"defaultValue":E=L;break;case"multiple":f=L;default:gt(i,o,v,L,c,null)}o=x,c=E,i.multiple=!!f,o!=null?xl(i,!!f,o,!1):c!=null&&xl(i,!!f,c,!0);return;case"textarea":Qe("invalid",i),x=v=f=null;for(E in c)if(c.hasOwnProperty(E)&&(L=c[E],L!=null))switch(E){case"value":f=L;break;case"defaultValue":v=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:gt(i,o,E,L,c,null)}G0(i,f,v,x);return;case"option":for(K in c)if(c.hasOwnProperty(K)&&(f=c[K],f!=null))switch(K){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:gt(i,o,K,f,c,null)}return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(f=0;f<Nc.length;f++)Qe(Nc[f],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("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(te in c)if(c.hasOwnProperty(te)&&(f=c[te],f!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:gt(i,o,te,f,c,null)}return;default:if(Kp(o)){for(de in c)c.hasOwnProperty(de)&&(f=c[de],f!==void 0&&Og(i,o,de,f,c,void 0));return}}for(L in c)c.hasOwnProperty(L)&&(f=c[L],f!=null&>(i,o,L,f,c,null))}function _O(i,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,x=null,E=null,L=null,K=null,te=null,de=null;for(ae in c){var pe=c[ae];if(c.hasOwnProperty(ae)&&pe!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":K=pe;default:f.hasOwnProperty(ae)||gt(i,o,ae,null,f,pe)}}for(var ne in f){var ae=f[ne];if(pe=c[ne],f.hasOwnProperty(ne)&&(ae!=null||pe!=null))switch(ne){case"type":x=ae;break;case"name":v=ae;break;case"checked":te=ae;break;case"defaultChecked":de=ae;break;case"value":E=ae;break;case"defaultValue":L=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,o));break;default:ae!==pe&>(i,o,ne,ae,f,pe)}}Vp(i,E,L,K,te,de,x,v);return;case"select":ae=E=L=ne=null;for(x in c)if(K=c[x],c.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":ae=K;default:f.hasOwnProperty(x)||gt(i,o,x,null,f,K)}for(v in f)if(x=f[v],K=c[v],f.hasOwnProperty(v)&&(x!=null||K!=null))switch(v){case"value":ne=x;break;case"defaultValue":L=x;break;case"multiple":E=x;default:x!==K&>(i,o,v,x,f,K)}o=L,c=E,f=ae,ne!=null?xl(i,!!c,ne,!1):!!f!=!!c&&(o!=null?xl(i,!!c,o,!0):xl(i,!!c,c?[]:"",!1));return;case"textarea":ae=ne=null;for(L in c)if(v=c[L],c.hasOwnProperty(L)&&v!=null&&!f.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:gt(i,o,L,null,f,v)}for(E in f)if(v=f[E],x=c[E],f.hasOwnProperty(E)&&(v!=null||x!=null))switch(E){case"value":ne=v;break;case"defaultValue":ae=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==x&>(i,o,E,v,f,x)}K0(i,ne,ae);return;case"option":for(var Te in c)if(ne=c[Te],c.hasOwnProperty(Te)&&ne!=null&&!f.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,o,Te,null,f,ne)}for(K in f)if(ne=f[K],ae=c[K],f.hasOwnProperty(K)&&ne!==ae&&(ne!=null||ae!=null))switch(K){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:gt(i,o,K,ne,f,ae)}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 Pe in c)ne=c[Pe],c.hasOwnProperty(Pe)&&ne!=null&&!f.hasOwnProperty(Pe)&>(i,o,Pe,null,f,ne);for(te in f)if(ne=f[te],ae=c[te],f.hasOwnProperty(te)&&ne!==ae&&(ne!=null||ae!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,o));break;default:gt(i,o,te,ne,f,ae)}return;default:if(Kp(o)){for(var vt in c)ne=c[vt],c.hasOwnProperty(vt)&&ne!==void 0&&!f.hasOwnProperty(vt)&&Og(i,o,vt,void 0,f,ne);for(de in f)ne=f[de],ae=c[de],!f.hasOwnProperty(de)||ne===ae||ne===void 0&&ae===void 0||Og(i,o,de,ne,f,ae);return}}for(var Q in c)ne=c[Q],c.hasOwnProperty(Q)&&ne!=null&&!f.hasOwnProperty(Q)&>(i,o,Q,null,f,ne);for(pe in f)ne=f[pe],ae=c[pe],!f.hasOwnProperty(pe)||ne===ae||ne==null&&ae==null||gt(i,o,pe,ne,f,ae)}function ZS(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,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var v=c[f],x=v.transferSize,E=v.initiatorType,L=v.duration;if(x&&L&&ZS(E)){for(E=0,L=v.responseEnd,f+=1;f<c.length;f++){var K=c[f],te=K.startTime;if(te>L)break;var de=K.transferSize,pe=K.initiatorType;de&&ZS(pe)&&(K=K.responseEnd,E+=de*(K<L?1:(L-te)/(K-te)))}if(--f,o+=8*(x+E)/(v.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Lg=null,jg=null;function lh(i){return i.nodeType===9?i:i.ownerDocument}function QS(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 JS(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function zg(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Pg=null;function bO(){var i=window.event;return i&&i.type==="popstate"?i===Pg?!1:(Pg=i,!0):(Pg=null,!1)}var ew=typeof setTimeout=="function"?setTimeout:void 0,xO=typeof clearTimeout=="function"?clearTimeout:void 0,tw=typeof Promise=="function"?Promise:void 0,SO=typeof queueMicrotask=="function"?queueMicrotask:typeof tw<"u"?function(i){return tw.resolve(null).then(i).catch(wO)}:ew;function wO(i){setTimeout(function(){throw i})}function Is(i){return i==="head"}function nw(i,o){var c=o,f=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(v),Jl(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Dc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Dc(c);for(var x=c.firstChild;x;){var E=x.nextSibling,L=x.nodeName;x[Xa]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=E}}else c==="body"&&Dc(i.ownerDocument.body);c=v}while(c);Jl(o)}function rw(i,o){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function Bg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Bg(c),$p(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function CO(i,o,c,f){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Xa])switch(o){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!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var x=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=zr(i.nextSibling),i===null)break}return null}function kO(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=zr(i.nextSibling),i===null))return null;return i}function iw(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=zr(i.nextSibling),i===null))return null;return i}function Ig(i){return i.data==="$?"||i.data==="$~"}function Hg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function EO(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function zr(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Fg=null;function sw(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return zr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function ow(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function lw(i,o,c){switch(o=lh(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Dc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);$p(i)}var Pr=new Map,aw=new Set;function ah(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var es=q.d;q.d={f:RO,r:TO,D:MO,C:NO,L:AO,m:DO,X:LO,S:OO,M:jO};function RO(){var i=es.f(),o=Jd();return i||o}function TO(i){var o=_l(i);o!==null&&o.tag===5&&o.type==="form"?k1(o):es.r(i)}var Xl=typeof document>"u"?null:document;function cw(i,o,c){var f=Xl;if(f&&typeof o=="string"&&o){var v=Mr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),aw.has(v)||(aw.add(v),i={rel:i,crossOrigin:c,href:o},f.querySelector(v)===null&&(o=f.createElement("link"),Tn(o,"link",i),fn(o),f.head.appendChild(o)))}}function MO(i){es.D(i),cw("dns-prefetch",i,null)}function NO(i,o){es.C(i,o),cw("preconnect",i,o)}function AO(i,o,c){es.L(i,o,c);var f=Xl;if(f&&i&&o){var v='link[rel="preload"][as="'+Mr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Mr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Mr(c.imageSizes)+'"]')):v+='[href="'+Mr(i)+'"]';var x=v;switch(o){case"style":x=Zl(i);break;case"script":x=Ql(i)}Pr.has(x)||(i=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),Pr.set(x,i),f.querySelector(v)!==null||o==="style"&&f.querySelector(Oc(x))||o==="script"&&f.querySelector(Lc(x))||(o=f.createElement("link"),Tn(o,"link",i),fn(o),f.head.appendChild(o)))}}function DO(i,o){es.m(i,o);var c=Xl;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Mr(f)+'"][href="'+Mr(i)+'"]',x=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ql(i)}if(!Pr.has(x)&&(i=m({rel:"modulepreload",href:i},o),Pr.set(x,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Lc(x)))return}f=c.createElement("link"),Tn(f,"link",i),fn(f),c.head.appendChild(f)}}}function OO(i,o,c){es.S(i,o,c);var f=Xl;if(f&&i){var v=yl(f).hoistableStyles,x=Zl(i);o=o||"default";var E=v.get(x);if(!E){var L={loading:0,preload:null};if(E=f.querySelector(Oc(x)))L.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},c),(c=Pr.get(x))&&Ug(i,c);var K=E=f.createElement("link");fn(K),Tn(K,"link",i),K._p=new Promise(function(te,de){K.onload=te,K.onerror=de}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,ch(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:L},v.set(x,E)}}}function LO(i,o){es.X(i,o);var c=Xl;if(c&&i){var f=yl(c).hoistableScripts,v=Ql(i),x=f.get(v);x||(x=c.querySelector(Lc(v)),x||(i=m({src:i,async:!0},o),(o=Pr.get(v))&&$g(i,o),x=c.createElement("script"),fn(x),Tn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function jO(i,o){es.M(i,o);var c=Xl;if(c&&i){var f=yl(c).hoistableScripts,v=Ql(i),x=f.get(v);x||(x=c.querySelector(Lc(v)),x||(i=m({src:i,async:!0,type:"module"},o),(o=Pr.get(v))&&$g(i,o),x=c.createElement("script"),fn(x),Tn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function uw(i,o,c,f){var v=(v=se.current)?ah(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Zl(c.href),c=yl(v).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Zl(c.href);var x=yl(v).hoistableStyles,E=x.get(i);if(E||(v=v.ownerDocument||v,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,E),(x=v.querySelector(Oc(i)))&&!x._p&&(E.instance=x,E.state.loading=5),Pr.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},Pr.set(i,c),x||zO(v,i,c,E.state))),o&&f===null)throw Error(r(528,""));return E}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Ql(c),c=yl(v).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Zl(i){return'href="'+Mr(i)+'"'}function Oc(i){return'link[rel="stylesheet"]['+i+"]"}function dw(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function zO(i,o,c,f){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=i.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),Tn(o,"link",c),fn(o),i.head.appendChild(o))}function Ql(i){return'[src="'+Mr(i)+'"]'}function Lc(i){return"script[async]"+i}function hw(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Mr(c.href)+'"]');if(f)return o.instance=f,fn(f),f;var v=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),fn(f),Tn(f,"style",v),ch(f,c.precedence,i),o.instance=f;case"stylesheet":v=Zl(c.href);var x=i.querySelector(Oc(v));if(x)return o.state.loading|=4,o.instance=x,fn(x),x;f=dw(c),(v=Pr.get(v))&&Ug(f,v),x=(i.ownerDocument||i).createElement("link"),fn(x);var E=x;return E._p=new Promise(function(L,K){E.onload=L,E.onerror=K}),Tn(x,"link",f),o.state.loading|=4,ch(x,c.precedence,i),o.instance=x;case"script":return x=Ql(c.src),(v=i.querySelector(Lc(x)))?(o.instance=v,fn(v),v):(f=c,(v=Pr.get(x))&&(f=m({},c),$g(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),fn(v),Tn(v,"link",f),i.head.appendChild(v),o.instance=v);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,ch(f,c.precedence,i));return o.instance}function ch(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,x=v,E=0;E<f.length;E++){var L=f[E];if(L.dataset.precedence===o)x=L;else if(x!==v)break}x?x.parentNode.insertBefore(i,x.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Ug(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function $g(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var uh=null;function fw(i,o,c){if(uh===null){var f=new Map,v=uh=new Map;v.set(c,f)}else v=uh,f=v.get(c),f||(f=new Map,v.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var x=c[v];if(!(x[Xa]||x[Cn]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(o)||"";E=i+E;var L=f.get(E);L?L.push(x):f.set(E,[x])}}return f}function pw(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function PO(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function mw(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function BO(i,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Zl(f.href),x=o.querySelector(Oc(v));if(x){o=x._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=dh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=x,fn(x);return}x=o.ownerDocument||o,f=dw(f),(v=Pr.get(v))&&Ug(f,v),x=x.createElement("link"),fn(x);var E=x;E._p=new Promise(function(L,K){E.onload=L,E.onerror=K}),Tn(x,"link",f),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=dh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var Wg=0;function IO(i,o){return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+o);0<i.imgBytes&&Wg===0&&(Wg=62500*yO());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Wg?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function dh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var hh=null;function fh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,hh=new Map,o.forEach(HO,i),hh=null,dh.call(i))}function HO(i,o){if(!(o.state.loading&4)){var c=hh.get(i);if(c)var f=c.get(null);else{c=new Map,hh.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<v.length;x++){var E=v[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}v=o.instance,E=v.getAttribute("data-precedence"),x=c.get(E)||f,x===f&&c.set(null,v),c.set(E,v),this.count++,f=dh.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),x?x.parentNode.insertBefore(v,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var jc={$$typeof:R,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function FO(i,o,c,f,v,x,E,L,K){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=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function gw(i,o,c,f,v,x,E,L,K,te,de,pe){return i=new FO(i,o,c,E,K,te,de,pe,L),o=1,x===!0&&(o|=24),x=fr(3,null,null,o),i.current=x,x.stateNode=i,o=wm(),o.refCount++,i.pooledCache=o,o.refCount++,x.memoizedState={element:f,isDehydrated:c,cache:o},Rm(x),i}function vw(i){return i?(i=Ml,i):Ml}function _w(i,o,c,f,v,x){v=vw(v),f.context===null?f.context=v:f.pendingContext=v,f=Ts(o),f.payload={element:c},x=x===void 0?null:x,x!==null&&(f.callback=x),c=Ms(i,f,o),c!==null&&(rr(c,i,o),fc(c,i,o))}function yw(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function Vg(i,o){yw(i,o),(i=i.alternate)&&yw(i,o)}function bw(i){if(i.tag===13||i.tag===31){var o=Co(i,67108864);o!==null&&rr(o,i,67108864),Vg(i,67108864)}}function xw(i){if(i.tag===13||i.tag===31){var o=_r();o=ji(o);var c=Co(i,o);c!==null&&rr(c,i,o),Vg(i,o)}}var ph=!0;function UO(i,o,c,f){var v=B.T;B.T=null;var x=q.p;try{q.p=2,qg(i,o,c,f)}finally{q.p=x,B.T=v}}function $O(i,o,c,f){var v=B.T;B.T=null;var x=q.p;try{q.p=8,qg(i,o,c,f)}finally{q.p=x,B.T=v}}function qg(i,o,c,f){if(ph){var v=Kg(f);if(v===null)Dg(i,o,f,mh,c),ww(i,f);else if(VO(v,i,o,c,f))f.stopPropagation();else if(ww(i,f),o&4&&-1<WO.indexOf(i)){for(;v!==null;){var x=_l(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=Dt(x.pendingLanes);if(E!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;E;){var K=1<<31-ot(E);L.entanglements[1]|=K,E&=~K}mi(x),(ut&6)===0&&(Zd=le()+500,Mc(0))}}break;case 31:case 13:L=Co(x,2),L!==null&&rr(L,x,2),Jd(),Vg(x,2)}if(x=Kg(f),x===null&&Dg(i,o,f,mh,c),x===v)break;v=x}v!==null&&f.stopPropagation()}else Dg(i,o,f,null,c)}}function Kg(i){return i=Yp(i),Gg(i)}var mh=null;function Gg(i){if(mh=null,i=vl(i),i!==null){var o=l(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=a(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return mh=i,null}function Sw(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(Rt()){case ue:return 2;case ve:return 8;case Le:case Ie:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Yg=!1,Hs=null,Fs=null,Us=null,zc=new Map,Pc=new Map,$s=[],WO="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 ww(i,o){switch(i){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":zc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(o.pointerId)}}function Bc(i,o,c,f,v,x){return i===null||i.nativeEvent!==x?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:x,targetContainers:[v]},o!==null&&(o=_l(o),o!==null&&bw(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function VO(i,o,c,f,v){switch(o){case"focusin":return Hs=Bc(Hs,i,o,c,f,v),!0;case"dragenter":return Fs=Bc(Fs,i,o,c,f,v),!0;case"mouseover":return Us=Bc(Us,i,o,c,f,v),!0;case"pointerover":var x=v.pointerId;return zc.set(x,Bc(zc.get(x)||null,i,o,c,f,v)),!0;case"gotpointercapture":return x=v.pointerId,Pc.set(x,Bc(Pc.get(x)||null,i,o,c,f,v)),!0}return!1}function Cw(i){var o=vl(i.target);if(o!==null){var c=l(o);if(c!==null){if(o=c.tag,o===13){if(o=a(c),o!==null){i.blockedOn=o,xs(i.priority,function(){xw(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,xs(i.priority,function(){xw(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function gh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Kg(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);Gp=f,c.target.dispatchEvent(f),Gp=null}else return o=_l(c),o!==null&&bw(o),i.blockedOn=c,!1;o.shift()}return!0}function kw(i,o,c){gh(i)&&c.delete(o)}function qO(){Yg=!1,Hs!==null&&gh(Hs)&&(Hs=null),Fs!==null&&gh(Fs)&&(Fs=null),Us!==null&&gh(Us)&&(Us=null),zc.forEach(kw),Pc.forEach(kw)}function vh(i,o){i.blockedOn===o&&(i.blockedOn=null,Yg||(Yg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qO)))}var _h=null;function Ew(i){_h!==i&&(_h=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_h===i&&(_h=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],v=i[o+2];if(typeof f!="function"){if(Gg(f||c)===null)continue;break}var x=_l(c);x!==null&&(i.splice(o,3),o-=3,Km(x,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}function Jl(i){function o(K){return vh(K,i)}Hs!==null&&vh(Hs,i),Fs!==null&&vh(Fs,i),Us!==null&&vh(Us,i),zc.forEach(o),Pc.forEach(o);for(var c=0;c<$s.length;c++){var f=$s[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<$s.length&&(c=$s[0],c.blockedOn===null);)Cw(c),c.blockedOn===null&&$s.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var v=c[f],x=c[f+1],E=v[Zn]||null;if(typeof x=="function")E||Ew(c);else if(E){var L=null;if(x&&x.hasAttribute("formAction")){if(v=x,E=x[Zn]||null)L=E.formAction;else if(Gg(v)!==null)continue}else L=E.action;typeof L=="function"?c[f+1]=L:(c.splice(f,3),f-=3),Ew(c)}}}function Rw(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return v=E})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),f||setTimeout(c,20)}function c(){if(!f&&!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 f=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function Xg(i){this._internalRoot=i}yh.prototype.render=Xg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=_r();_w(c,f,i,o,null,null)},yh.prototype.unmount=Xg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;_w(i.current,2,null,i,null,null),Jd(),o[gl]=null}};function yh(i){this._internalRoot=i}yh.prototype.unstable_scheduleHydration=function(i){if(i){var o=Xr();i={blockedOn:null,target:i,priority:o};for(var c=0;c<$s.length&&o!==0&&o<$s[c].priority;c++);$s.splice(c,0,i),c===0&&Cw(i)}};var Tw=t.version;if(Tw!=="19.2.1")throw Error(r(527,Tw,"19.2.1"));q.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var KO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bh.isDisabled&&bh.supportsFiber)try{nn=bh.inject(KO),Pt=bh}catch{}}return Fc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",v=j1,x=z1,E=P1;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(x=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=gw(i,1,!1,null,null,c,f,null,v,x,E,Rw),i[gl]=o.current,Ag(i),new Xg(o)},Fc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,v="",x=j1,E=z1,L=P1,K=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),o=gw(i,1,!0,o,c??null,f,v,K,x,E,L,Rw),o.context=vw(null),c=o.current,f=_r(),f=ji(f),v=Ts(f),v.callback=null,Ms(c,v,f),c=f,o.current.lanes=c,ur(o,c),mi(o),i[gl]=o.current,Ag(i),new yh(o)},Fc.version="19.2.1",Fc}var Uw;function s4(){if(Uw)return Jg.exports;Uw=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(),Jg.exports=i4(),Jg.exports}var o4=s4();/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var $w="popstate";function Ww(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function l4(e={}){function t(r,s){var d;let l=(d=s.state)==null?void 0:d.masked,{pathname:a,search:u,hash:h}=l||r.location;return h_("",{pathname:a,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:Cu(s)}return c4(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function si(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function a4(){return Math.random().toString(36).substring(2,10)}function Vw(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 h_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Na(t):t,state:n,key:t&&t.key||r||a4(),unstable_mask:s}}function Cu({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 Na(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 c4(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,a=s.history,u="POP",h=null,d=p();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function p(){return(a.state||{idx:null}).idx}function m(){u="POP";let C=p(),k=C==null?null:C-d;d=C,h&&h({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=Ww(C)?C:h_(w.location,C,k);d=p()+1;let R=Vw(T,d),M=w.createHref(T.unstable_mask||T);try{a.pushState(R,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(M)}l&&h&&h({action:u,location:w.location,delta:1})}function y(C,k){u="REPLACE";let T=Ww(C)?C:h_(w.location,C,k);d=p();let R=Vw(T,d),M=w.createHref(T.unstable_mask||T);a.replaceState(R,"",M),l&&h&&h({action:u,location:w.location,delta:0})}function S(C){return u4(C)}let w={get action(){return u},get location(){return e(s,a)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener($w,m),h=C,()=>{s.removeEventListener($w,m),h=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let k=S(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:y,go(C){return a.go(C)}};return w}function u4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Cu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function IE(e,t,n="/"){return d4(e,t,n,!1)}function d4(e,t,n,r){let s=typeof t=="string"?Na(t):t,l=us(s.pathname||"/",n);if(l==null)return null;let a=HE(e);h4(a);let u=null;for(let h=0;u==null&&h<a.length;++h){let d=w4(l);u=x4(a[h],d,r)}return u}function HE(e,t=[],n=[],r="",s=!1){let l=(a,u,h=s,d)=>{let p={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:u,route:a};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&h)return;Lt(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=Ei([r,p.relativePath]),_=n.concat(p);a.children&&a.children.length>0&&(Lt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),HE(a.children,t,_,m,h)),!(a.path==null&&!a.index)&&t.push({path:m,score:y4(m,a.index),routesMeta:_})};return e.forEach((a,u)=>{var h;if(a.path===""||!((h=a.path)!=null&&h.includes("?")))l(a,u);else for(let d of FE(a.path))l(a,u,!0,d)}),t}function FE(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let a=FE(r.join("/")),u=[];return u.push(...a.map(h=>h===""?l:[l,h].join("/"))),s&&u.push(...a),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function h4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:b4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var f4=/^:[\w-]+$/,p4=3,m4=2,g4=1,v4=10,_4=-2,qw=e=>e==="*";function y4(e,t){let n=e.split("/"),r=n.length;return n.some(qw)&&(r+=_4),t&&(r+=m4),n.filter(s=>!qw(s)).reduce((s,l)=>s+(f4.test(l)?p4:l===""?g4:v4),r)}function b4(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 x4(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",a=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",m=yf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},p),_=h.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=yf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},p)),!m)return null;Object.assign(s,m.params),a.push({params:s,pathname:Ei([l,m.pathname]),pathnameBase:R4(Ei([l,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(l=Ei([l,m.pathnameBase]))}return a}function yf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=S4(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],a=l.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:p,isOptional:m},_)=>{if(p==="*"){let S=u[_]||"";a=l.slice(0,l.length-S.length).replace(/(.)\/+$/,"$1")}const y=u[_];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function S4(e,t=!1,n=!0){si(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,(a,u,h,d,p)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let m=p.charAt(d+a.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 w4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return si(!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 us(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 C4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function k4(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Na(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Kw(n.substring(1),"/"):l=Kw(n,t)):l=t,{pathname:l,search:T4(r),hash:M4(s)}}function Kw(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 rv(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 E4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Xy(e){let t=E4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ep(e,t,n,r=!1){let s;typeof e=="string"?s=Na(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),rv("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),rv("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),rv("#","search","hash",s)));let l=e===""||s.pathname==="",a=l?"/":s.pathname,u;if(a==null)u=n;else{let m=t.length-1;if(!r&&a.startsWith("..")){let _=a.split("/");for(;_[0]==="..";)_.shift(),m-=1;s.pathname=_.join("/")}u=m>=0?t[m]:"/"}let h=k4(s,u),d=a&&a!=="/"&&a.endsWith("/"),p=(l||a===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||p)&&(h.pathname+="/"),h}var Ei=e=>e.join("/").replace(/\/\/+/g,"/"),R4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),T4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,M4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,N4=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 A4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function D4(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var UE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $E(e,t){let n=e;if(typeof n!="string"||!C4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(UE)try{let l=new URL(window.location.href),a=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=us(a.pathname,t);a.origin===l.origin&&u!=null?n=u+a.search+a.hash:s=!0}catch{si(!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 WE=["POST","PUT","PATCH","DELETE"];new Set(WE);var O4=["GET",...WE];new Set(O4);var Aa=b.createContext(null);Aa.displayName="DataRouter";var tp=b.createContext(null);tp.displayName="DataRouterState";var L4=b.createContext(!1),VE=b.createContext({isTransitioning:!1});VE.displayName="ViewTransition";var j4=b.createContext(new Map);j4.displayName="Fetchers";var z4=b.createContext(null);z4.displayName="Await";var kr=b.createContext(null);kr.displayName="Navigation";var Hu=b.createContext(null);Hu.displayName="Location";var qr=b.createContext({outlet:null,matches:[],isDataRoute:!1});qr.displayName="Route";var Zy=b.createContext(null);Zy.displayName="RouteError";var qE="REACT_ROUTER_ERROR",P4="REDIRECT",B4="ROUTE_ERROR_RESPONSE";function I4(e){if(e.startsWith(`${qE}:${P4}:{`))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 H4(e){if(e.startsWith(`${qE}:${B4}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new N4(t.status,t.statusText,t.data)}catch{}}function F4(e,{relative:t}={}){Lt(Da(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(kr),{hash:s,pathname:l,search:a}=Fu(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:Ei([n,l])),r.createHref({pathname:u,search:a,hash:s})}function Da(){return b.useContext(Hu)!=null}function ui(){return Lt(Da(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Hu).location}var KE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function GE(e){b.useContext(kr).static||b.useLayoutEffect(e)}function Oa(){let{isDataRoute:e}=b.useContext(qr);return e?tL():U4()}function U4(){Lt(Da(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Aa),{basename:t,navigator:n}=b.useContext(kr),{matches:r}=b.useContext(qr),{pathname:s}=ui(),l=JSON.stringify(Xy(r)),a=b.useRef(!1);return GE(()=>{a.current=!0}),b.useCallback((h,d={})=>{if(si(a.current,KE),!a.current)return;if(typeof h=="number"){n.go(h);return}let p=ep(h,JSON.parse(l),s,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ei([t,p.pathname])),(d.replace?n.replace:n.push)(p,d.state,d)},[t,n,l,s,e])}var YE=b.createContext(null);function Qy(){return b.useContext(YE)}function $4(e){let t=b.useContext(qr).outlet;return b.useMemo(()=>t&&b.createElement(YE.Provider,{value:e},t),[t,e])}function XE(){let{matches:e}=b.useContext(qr),t=e[e.length-1];return t?t.params:{}}function Fu(e,{relative:t}={}){let{matches:n}=b.useContext(qr),{pathname:r}=ui(),s=JSON.stringify(Xy(n));return b.useMemo(()=>ep(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function W4(e,t){return ZE(e,t)}function ZE(e,t,n){var C;Lt(Da(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(kr),{matches:s}=b.useContext(qr),l=s[s.length-1],a=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",d=l&&l.route;{let k=d&&d.path||"";JE(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 p=ui(),m;if(t){let k=typeof t=="string"?Na(t):t;Lt(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.`),m=k}else m=p;let _=m.pathname||"/",y=_;if(h!=="/"){let k=h.replace(/^\//,"").split("/");y="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=IE(e,{pathname:y});si(d||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),si(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 w=Y4(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:Ei([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Ei([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?b.createElement(Hu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},w):w}function V4(){let e=eL(),t=A4(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},l={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=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:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"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,a)}var q4=b.createElement(V4,null),QE=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=H4(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(qr.Provider,{value:this.props.routeContext},b.createElement(Zy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(K4,{error:e},t):t}};QE.contextType=L4;var iv=new WeakMap;function K4({children:e,error:t}){let{basename:n}=b.useContext(kr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=I4(t.digest);if(r){let s=iv.get(t);if(s)throw s;let l=$E(r.location,n);if(UE&&!iv.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw iv.set(t,a),a}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function G4({routeContext:e,match:t,children:n}){let r=b.useContext(Aa);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(qr.Provider,{value:e},n)}function Y4(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,l=r==null?void 0:r.errors;if(l!=null){let p=s.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Lt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let a=!1,u=-1;if(n&&r){a=r.renderFallback;for(let p=0;p<s.length;p++){let m=s[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:_,errors:y}=r,S=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!y||y[m.route.id]===void 0);if(m.route.lazy||S){n.isStatic&&(a=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(p,m)=>{var _,y;h(p,{location:r.location,params:((y=(_=r.matches)==null?void 0:_[0])==null?void 0:y.params)??{},unstable_pattern:D4(r.matches),errorInfo:m})}:void 0;return s.reduceRight((p,m,_)=>{let y,S=!1,w=null,C=null;r&&(y=l&&m.route.id?l[m.route.id]:void 0,w=m.route.errorElement||q4,a&&(u<0&&_===0?(JE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):u===_&&(S=!0,C=m.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),T=()=>{let R;return y?R=w:S?R=C:m.route.Component?R=b.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=p,b.createElement(G4,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:R})};return r&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?b.createElement(QE,{location:r.location,revalidation:r.revalidation,component:w,error:y,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):T()},null)}function Jy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X4(e){let t=b.useContext(Aa);return Lt(t,Jy(e)),t}function Z4(e){let t=b.useContext(tp);return Lt(t,Jy(e)),t}function Q4(e){let t=b.useContext(qr);return Lt(t,Jy(e)),t}function eb(e){let t=Q4(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function J4(){return eb("useRouteId")}function eL(){var r;let e=b.useContext(Zy),t=Z4("useRouteError"),n=eb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function tL(){let{router:e}=X4("useNavigate"),t=eb("useNavigate"),n=b.useRef(!1);return GE(()=>{n.current=!0}),b.useCallback(async(s,l={})=>{si(n.current,KE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Gw={};function JE(e,t,n){!t&&!Gw[e]&&(Gw[e]=!0,si(!1,n))}b.memo(nL);function nL({routes:e,future:t,state:n,isStatic:r,onError:s}){return ZE(e,void 0,{state:n,isStatic:r,onError:s})}function rL({to:e,replace:t,state:n,relative:r}){Lt(Da(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(kr);si(!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:l}=b.useContext(qr),{pathname:a}=ui(),u=Oa(),h=ep(e,Xy(l),a,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 iL(e){return $4(e.context)}function ua(e){Lt(!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 sL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:a}){Lt(!Da(),"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:l,unstable_useTransitions:a,future:{}}),[u,s,l,a]);typeof n=="string"&&(n=Na(n));let{pathname:d="/",search:p="",hash:m="",state:_=null,key:y="default",unstable_mask:S}=n,w=b.useMemo(()=>{let C=us(d,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:_,key:y,unstable_mask:S},navigationType:r}},[u,d,p,m,_,y,r,S]);return si(w!=null,`<Router basename="${u}"> is not able to match the URL "${d}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(kr.Provider,{value:h},b.createElement(Hu.Provider,{children:t,value:w}))}function oL({children:e,location:t}){return W4(f_(e),t)}function f_(e,t=[]){let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let l=[...t,s];if(r.type===b.Fragment){n.push.apply(n,f_(r.props.children,l));return}Lt(r.type===ua,`[${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>`),Lt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||l.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&&(a.children=f_(r.props.children,l)),n.push(a)}),n}var Qh="get",Jh="application/x-www-form-urlencoded";function np(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function lL(e){return np(e)&&e.tagName.toLowerCase()==="button"}function aL(e){return np(e)&&e.tagName.toLowerCase()==="form"}function cL(e){return np(e)&&e.tagName.toLowerCase()==="input"}function uL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dL(e,t){return e.button===0&&(!t||t==="_self")&&!uL(e)}var xh=null;function hL(){if(xh===null)try{new FormData(document.createElement("form"),0),xh=!1}catch{xh=!0}return xh}var fL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sv(e){return e!=null&&!fL.has(e)?(si(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jh}"`),null):e}function pL(e,t){let n,r,s,l,a;if(aL(e)){let u=e.getAttribute("action");r=u?us(u,t):null,n=e.getAttribute("method")||Qh,s=sv(e.getAttribute("enctype"))||Jh,l=new FormData(e)}else if(lL(e)||cL(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?us(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Qh,s=sv(e.getAttribute("formenctype"))||sv(u.getAttribute("enctype"))||Jh,l=new FormData(u,e),!hL()){let{name:d,type:p,value:m}=e;if(p==="image"){let _=d?`${d}.`:"";l.append(`${_}x`,"0"),l.append(`${_}y`,"0")}else d&&l.append(d,m)}}else{if(np(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qh,r=null,s=Jh,a=e}return l&&s==="text/plain"&&(a=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function tb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mL(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&&us(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function gL(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 vL(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 _L(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let a=await gL(l,n);return a.links?a.links():[]}return[]}));return SL(r.flat(1).filter(vL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Yw(e,t,n,r,s,l){let a=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var p;return n[d].pathname!==h.pathname||((p=n[d].route.path)==null?void 0:p.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,d)=>a(h,d)||u(h,d)):l==="data"?t.filter((h,d)=>{var m;let p=r.routes[h.route.id];if(!p||!p.hasLoader)return!1;if(a(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let _=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function yL(e,t,{includeHydrateFallback:n}={}){return bL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function bL(e){return[...new Set(e)]}function xL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function SL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(xL(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function eR(){let e=b.useContext(Aa);return tb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wL(){let e=b.useContext(tp);return tb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var nb=b.createContext(void 0);nb.displayName="FrameworkContext";function tR(){let e=b.useContext(nb);return tb(e,"You must render this element inside a <HydratedRouter> element"),e}function CL(e,t){let n=b.useContext(nb),[r,s]=b.useState(!1),[l,a]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:p,onTouchStart:m}=t,_=b.useRef(null);b.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let w=k=>{k.forEach(T=>{a(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(r){let w=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{s(!0)},S=()=>{s(!1),a(!1)};return n?e!=="intent"?[l,_,{}]:[l,_,{onFocus:Uc(u,y),onBlur:Uc(h,S),onMouseEnter:Uc(d,y),onMouseLeave:Uc(p,S),onTouchStart:Uc(m,y)}]:[!1,_,{}]}function Uc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kL({page:e,...t}){let{router:n}=eR(),r=b.useMemo(()=>IE(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?b.createElement(RL,{page:e,matches:r,...t}):null}function EL(e){let{manifest:t,routeModules:n}=tR(),[r,s]=b.useState([]);return b.useEffect(()=>{let l=!1;return _L(e,t,n).then(a=>{l||s(a)}),()=>{l=!0}},[e,t,n]),r}function RL({page:e,matches:t,...n}){let r=ui(),{future:s,manifest:l,routeModules:a}=tR(),{basename:u}=eR(),{loaderData:h,matches:d}=wL(),p=b.useMemo(()=>Yw(e,t,d,l,r,"data"),[e,t,d,l,r]),m=b.useMemo(()=>Yw(e,t,d,l,r,"assets"),[e,t,d,l,r]),_=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var M;let R=l.routes[T.route.id];!R||!R.hasLoader||(!p.some(O=>O.route.id===T.route.id)&&T.route.id in h&&((M=a[T.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=mL(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&k.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,r,l,p,t,e,a]),y=b.useMemo(()=>yL(m,l),[m,l]),S=EL(m);return b.createElement(b.Fragment,null,_.map(w=>b.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>b.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>b.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function TL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ML=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ML&&(window.__reactRouterVersion="7.13.1")}catch{}function NL({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=b.useRef();s.current==null&&(s.current=l4({window:r,v5Compat:!0}));let l=s.current,[a,u]=b.useState({action:l.action,location:l.location}),h=b.useCallback(d=>{n===!1?u(d):b.startTransition(()=>u(d))},[n]);return b.useLayoutEffect(()=>l.listen(h),[l,h]),b.createElement(sL,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:l,unstable_useTransitions:n})}var nR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rR=b.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:a,unstable_mask:u,state:h,target:d,to:p,preventScrollReset:m,viewTransition:_,unstable_defaultShouldRevalidate:y,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=b.useContext(kr),R=typeof p=="string"&&nR.test(p),M=$E(p,C);p=M.to;let O=F4(p,{relative:s}),D=ui(),j=null;if(u){let H=ep(u,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&(H.pathname=H.pathname==="/"?C:Ei([C,H.pathname])),j=k.createHref(H)}let[F,G,P]=CL(r,S),W=LL(p,{replace:a,unstable_mask:u,state:h,target:d,preventScrollReset:m,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function I(H){t&&t(H),H.defaultPrevented||W(H)}let $=!(M.isExternal||l),U=b.createElement("a",{...S,...P,href:($?j:void 0)||M.absoluteURL||O,onClick:$?I:t,ref:TL(w,G),target:d,"data-discover":!R&&n==="render"?"true":void 0});return F&&!R?b.createElement(b.Fragment,null,U,b.createElement(kL,{page:O})):U});rR.displayName="Link";var AL=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:a,viewTransition:u,children:h,...d},p){let m=Fu(a,{relative:d.relative}),_=ui(),y=b.useContext(tp),{navigator:S,basename:w}=b.useContext(kr),C=y!=null&&IL(m)&&u===!0,k=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,T=_.pathname,R=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=us(R,w)||R);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let O=T===k||!s&&T.startsWith(k)&&T.charAt(M)==="/",D=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),j={isActive:O,isPending:D,isTransitioning:C},F=O?t:void 0,G;typeof r=="function"?G=r(j):G=[r,O?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let P=typeof l=="function"?l(j):l;return b.createElement(rR,{...d,"aria-current":F,className:G,ref:p,style:P,to:a,viewTransition:u},typeof h=="function"?h(j):h)});AL.displayName="NavLink";var DL=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:a=Qh,action:u,onSubmit:h,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_,...y},S)=>{let{unstable_useTransitions:w}=b.useContext(kr),C=PL(),k=BL(u,{relative:d}),T=a.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&nR.test(u),M=O=>{if(h&&h(O),O.defaultPrevented)return;O.preventDefault();let D=O.nativeEvent.submitter,j=(D==null?void 0:D.getAttribute("formmethod"))||a,F=()=>C(D||O.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:s,state:l,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_});w&&n!==!1?b.startTransition(()=>F()):F()};return b.createElement("form",{ref:S,method:T,action:k,onSubmit:r?h:M,...y,"data-discover":!R&&e==="render"?"true":void 0})});DL.displayName="Form";function OL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iR(e){let t=b.useContext(Aa);return Lt(t,OL(e)),t}function LL(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let p=Oa(),m=ui(),_=Fu(e,{relative:a});return b.useCallback(y=>{if(dL(y,t)){y.preventDefault();let S=n!==void 0?n:Cu(m)===Cu(_),w=()=>p(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h});d?b.startTransition(()=>w()):w()}},[m,p,_,n,r,s,t,e,l,a,u,h,d])}var jL=0,zL=()=>`__${String(++jL)}__`;function PL(){let{router:e}=iR("useSubmit"),{basename:t}=b.useContext(kr),n=J4(),r=e.fetch,s=e.navigate;return b.useCallback(async(l,a={})=>{let{action:u,method:h,encType:d,formData:p,body:m}=pL(l,t);if(a.navigate===!1){let _=a.fetcherKey||zL();await r(_,n,a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||h,formEncType:a.encType||d,flushSync:a.flushSync})}else await s(a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||h,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,s,t,n])}function BL(e,{relative:t}={}){let{basename:n}=b.useContext(kr),r=b.useContext(qr);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...Fu(e||".",{relative:t})},a=ui();if(e==null){l.search=a.search;let u=new URLSearchParams(l.search),h=u.getAll("index");if(h.some(p=>p==="")){u.delete("index"),h.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ei([n,l.pathname])),Cu(l)}function IL(e,{relative:t}={}){let n=b.useContext(VE);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=iR("useViewTransitionState"),s=Fu(e,{relative:t});if(!n.isTransitioning)return!1;let l=us(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=us(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yf(s.pathname,a)!=null||yf(s.pathname,l)!=null}var Si=BE();const HL=Jf(Si);function sR(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=sR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oR(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=sR(e))&&(r&&(r+=" "),r+=t);return r}const Xw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zw=oR,FL=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,a=Object.keys(s).map(d=>{const p=n==null?void 0:n[d],m=l==null?void 0:l[d];if(p===null)return null;const _=Xw(p)||Xw(m);return s[d][_]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,_]=p;return _===void 0||(d[m]=_),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:_,...y}=p;return Object.entries(y).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...l,...u}[w]):{...l,...u}[w]===C})?[...d,m,_]:d},[]);return Zw(e,a,h,n==null?void 0:n.class,n==null?void 0:n.className)},UL=(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},$L=(e,t)=>({classGroupId:e,validator:t}),lR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bf="-",Qw=[],WL="arbitrary..",VL=e=>{const t=KL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return qL(a);const u=a.split(bf),h=u[0]===""&&u.length>1?1:0;return aR(u,h,t)},getConflictingClassGroupIds:(a,u)=>{if(u){const h=r[a],d=n[a];return h?d?UL(d,h):h:d||Qw}return n[a]||Qw}}},aR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const d=aR(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const u=t===0?e.join(bf):e.slice(t).join(bf),h=a.length;for(let d=0;d<h;d++){const p=a[d];if(p.validator(u))return p.classGroupId}},qL=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?WL+r:void 0})(),KL=e=>{const{theme:t,classGroups:n}=e;return GL(n,t)},GL=(e,t)=>{const n=lR();for(const r in e){const s=e[r];rb(s,n,r,t)}return n},rb=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const a=e[l];YL(a,t,n,r)}},YL=(e,t,n,r)=>{if(typeof e=="string"){XL(e,t,n);return}if(typeof e=="function"){ZL(e,t,n,r);return}QL(e,t,n,r)},XL=(e,t,n)=>{const r=e===""?t:cR(t,e);r.classGroupId=n},ZL=(e,t,n,r)=>{if(JL(e)){rb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($L(n,e))},QL=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let a=0;a<l;a++){const[u,h]=s[a];rb(h,cR(t,u),n,r)}},cR=(e,t)=>{let n=e;const r=t.split(bf),s=r.length;for(let l=0;l<s;l++){const a=r[l];let u=n.nextPart.get(a);u||(u=lR(),n.nextPart.set(a,u)),n=u}return n},JL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ej=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(l,a)=>{n[l]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return s(l,a),a},set(l,a){l in n?n[l]=a:s(l,a)}}},p_="!",Jw=":",tj=[],eC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),nj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let a=0,u=0,h=0,d;const p=s.length;for(let w=0;w<p;w++){const C=s[w];if(a===0&&u===0){if(C===Jw){l.push(s.slice(h,w)),h=w+1;continue}if(C==="/"){d=w;continue}}C==="["?a++:C==="]"?a--:C==="("?u++:C===")"&&u--}const m=l.length===0?s:s.slice(h);let _=m,y=!1;m.endsWith(p_)?(_=m.slice(0,-1),y=!0):m.startsWith(p_)&&(_=m.slice(1),y=!0);const S=d&&d>h?d-h:void 0;return eC(l,y,_,S)};if(t){const s=t+Jw,l=r;r=a=>a.startsWith(s)?l(a.slice(s.length)):eC(tj,!1,a,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},rj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const a=n[l],u=a[0]==="[",h=t.has(a);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},ij=e=>({cache:ej(e.cacheSize),parseClassName:nj(e),sortModifiers:rj(e),...VL(e)}),sj=/\s+/,oj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,a=[],u=e.trim().split(sj);let h="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:_,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(m){h=p+(h.length>0?" "+h:h);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){h=p+(h.length>0?" "+h:h);continue}if(k=r(S),!k){h=p+(h.length>0?" "+h:h);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:l(_).join(":"),R=y?T+p_:T,M=R+k;if(a.indexOf(M)>-1)continue;a.push(M);const O=s(k,C);for(let D=0;D<O.length;++D){const j=O[D];a.push(R+j)}h=p+(h.length>0?" "+h:h)}return h},lj=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=uR(n))&&(s&&(s+=" "),s+=r);return s},uR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=uR(e[r]))&&(n&&(n+=" "),n+=t);return n},aj=(e,...t)=>{let n,r,s,l;const a=h=>{const d=t.reduce((p,m)=>m(p),e());return n=ij(d),r=n.cache.get,s=n.cache.set,l=u,u(h)},u=h=>{const d=r(h);if(d)return d;const p=oj(h,n);return s(h,p),p};return l=a,(...h)=>l(lj(...h))},cj=[],ln=e=>{const t=n=>n[e]||cj;return t.isThemeGetter=!0,t},dR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hj=/\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$/,fj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vs=e=>uj.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),qs=e=>!!e&&Number.isInteger(Number(e)),ov=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ts=e=>dj.test(e),fR=()=>!0,gj=e=>hj.test(e)&&!fj.test(e),ib=()=>!1,vj=e=>pj.test(e),_j=e=>mj.test(e),yj=e=>!Ne(e)&&!Ae(e),bj=e=>fo(e,gR,ib),Ne=e=>dR.test(e),Po=e=>fo(e,vR,gj),tC=e=>fo(e,Tj,Ke),xj=e=>fo(e,yR,fR),Sj=e=>fo(e,_R,ib),nC=e=>fo(e,pR,ib),wj=e=>fo(e,mR,_j),Sh=e=>fo(e,bR,vj),Ae=e=>hR.test(e),$c=e=>cl(e,vR),Cj=e=>cl(e,_R),rC=e=>cl(e,pR),kj=e=>cl(e,gR),Ej=e=>cl(e,mR),wh=e=>cl(e,bR,!0),Rj=e=>cl(e,yR,!0),fo=(e,t,n)=>{const r=dR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cl=(e,t,n=!1)=>{const r=hR.exec(e);return r?r[1]?t(r[1]):n:!1},pR=e=>e==="position"||e==="percentage",mR=e=>e==="image"||e==="url",gR=e=>e==="length"||e==="size"||e==="bg-size",vR=e=>e==="length",Tj=e=>e==="number",_R=e=>e==="family-name",yR=e=>e==="number"||e==="weight",bR=e=>e==="shadow",Mj=()=>{const e=ln("color"),t=ln("font"),n=ln("text"),r=ln("font-weight"),s=ln("tracking"),l=ln("leading"),a=ln("breakpoint"),u=ln("container"),h=ln("spacing"),d=ln("radius"),p=ln("shadow"),m=ln("inset-shadow"),_=ln("text-shadow"),y=ln("drop-shadow"),S=ln("blur"),w=ln("perspective"),C=ln("aspect"),k=ln("ease"),T=ln("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...M(),Ae,Ne],D=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],F=()=>[Ae,Ne,h],G=()=>[Vs,"full","auto",...F()],P=()=>[qs,"none","subgrid",Ae,Ne],W=()=>["auto",{span:["full",qs,Ae,Ne]},qs,Ae,Ne],I=()=>[qs,"auto",Ae,Ne],$=()=>["auto","min","max","fr",Ae,Ne],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...F()],q=()=>[Vs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],V=()=>[Vs,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Z=()=>[Vs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],N=()=>[e,Ae,Ne],z=()=>[...M(),rC,nC,{position:[Ae,Ne]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",kj,bj,{size:[Ae,Ne]}],oe=()=>[ov,$c,Po],fe=()=>["","none","full",d,Ae,Ne],se=()=>["",Ke,$c,Po],J=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ke,ov,rC,nC],ce=()=>["","none",S,Ae,Ne],we=()=>["none",Ke,Ae,Ne],Se=()=>["none",Ke,Ae,Ne],ke=()=>[Ke,Ae,Ne],Be=()=>[Vs,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ts],breakpoint:[ts],color:[fR],container:[ts],"drop-shadow":[ts],ease:["in","out","in-out"],font:[yj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ts],shadow:[ts],spacing:["px",Ke],text:[ts],"text-shadow":[ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vs,Ne,Ae,C]}],container:["container"],columns:[{columns:[Ke,Ne,Ae,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow: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:[qs,"auto",Ae,Ne]}],basis:[{basis:[Vs,"full","auto",u,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Vs,"auto","initial","none",Ne]}],grow:[{grow:["",Ke,Ae,Ne]}],shrink:[{shrink:["",Ke,Ae,Ne]}],order:[{order:[qs,"first","last","none",Ae,Ne]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:W()}],"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":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,$c,Po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Rj,xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ov,Ne]}],"font-family":[{font:[Cj,Sj,t]}],"font-features":[{"font-features":[Ne]}],"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,Ae,Ne]}],"line-clamp":[{"line-clamp":[Ke,"none",Ae,tC]}],leading:[{leading:[l,...F()]}],"list-image":[{"list-image":["none",Ae,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ae,Po]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ae,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Ne]}],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",Ae,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qs,Ae,Ne],radial:["",Ae,Ne],conic:[qs,Ae,Ne]},Ej,wj]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ae,Ne]}],"outline-w":[{outline:["",Ke,$c,Po]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",p,wh,Sh]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",m,wh,Sh]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Ke,Po]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",_,wh,Sh]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Ke,Ae,Ne]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Ae,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Ne]}],filter:[{filter:["","none",Ae,Ne]}],blur:[{blur:ce()}],brightness:[{brightness:[Ke,Ae,Ne]}],contrast:[{contrast:[Ke,Ae,Ne]}],"drop-shadow":[{"drop-shadow":["","none",y,wh,Sh]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Ke,Ae,Ne]}],"hue-rotate":[{"hue-rotate":[Ke,Ae,Ne]}],invert:[{invert:["",Ke,Ae,Ne]}],saturate:[{saturate:[Ke,Ae,Ne]}],sepia:[{sepia:["",Ke,Ae,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Ne]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ae,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ae,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ae,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ae,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ae,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ae,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ae,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ae,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ae,Ne]}],ease:[{ease:["linear","initial",k,Ae,Ne]}],delay:[{delay:[Ke,Ae,Ne]}],animate:[{animate:["none",T,Ae,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,Ne]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Ae,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",Ae,Ne]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ae,Ne]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Ke,$c,Po,tC]}],stroke:[{stroke:["none",...N()]}],"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"]}},Nj=aj(Mj);function ye(...e){return Nj(oR(e))}function lv(){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 iC(e){return e.startsWith("chatId:")?e.slice(7):e}const sb=FL("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 disabled:bg-transparent disabled:text-foreground/50 border-inpu 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"}}),rt=b.forwardRef(({className:e,variant:t,size:n,...r},s)=>g.jsx("button",{className:ye(sb({variant:t,size:n,className:e})),ref:s,...r}));rt.displayName="Button";function Re(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 sC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ob(...e){return t=>{let n=!1;const r=e.map(s=>{const l=sC(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():sC(e[s],null)}}}}function ht(...e){return b.useCallback(ob(...e),e)}function Aj(e,t){const n=b.createContext(t),r=l=>{const{children:a,...u}=l,h=b.useMemo(()=>u,Object.values(u));return g.jsx(n.Provider,{value:h,children:a})};r.displayName=e+"Provider";function s(l){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function ms(e,t=[]){let n=[];function r(l,a){const u=b.createContext(a),h=n.length;n=[...n,a];const d=m=>{var k;const{scope:_,children:y,...S}=m,w=((k=_==null?void 0:_[e])==null?void 0:k[h])||u,C=b.useMemo(()=>S,Object.values(S));return g.jsx(w.Provider,{value:C,children:y})};d.displayName=l+"Provider";function p(m,_){var w;const y=((w=_==null?void 0:_[e])==null?void 0:w[h])||u,S=b.useContext(y);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[d,p]}const s=()=>{const l=n.map(a=>b.createContext(a));return function(u){const h=(u==null?void 0:u[e])||l;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,Dj(s,...t)]}function Dj(...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(l){const a=r.reduce((u,{useScope:h,scopeName:d})=>{const m=h(l)[`__scope${d}`];return{...u,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Pn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},Oj=PE[" useId ".trim().toString()]||(()=>{}),Lj=0;function cs(e){const[t,n]=b.useState(Oj());return Pn(()=>{n(r=>r??String(Lj++))},[e]),t?`radix-${t}`:""}var jj=PE[" useInsertionEffect ".trim().toString()]||Pn;function wa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,a]=zj({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"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.`),p.current=u},[u,r])}const d=b.useCallback(p=>{var m;if(u){const _=Pj(p)?p(e):p;_!==e&&((m=a.current)==null||m.call(a,_))}else l(p)},[u,e,l,a]);return[h,d]}function zj({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),l=b.useRef(t);return jj(()=>{l.current=t},[t]),b.useEffect(()=>{var a;s.current!==n&&((a=l.current)==null||a.call(l,n),s.current=n)},[n,s]),[n,r,l]}function Pj(e){return typeof e=="function"}function Qo(e){const t=Bj(e),n=b.forwardRef((r,s)=>{const{children:l,...a}=r,u=b.Children.toArray(l),h=u.find(Hj);if(h){const d=h.props.children,p=u.map(m=>m===h?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return g.jsx(t,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,p):null})}return g.jsx(t,{...a,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function Bj(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const a=Uj(s),u=Fj(l,s.props);return s.type!==b.Fragment&&(u.ref=r?ob(r,a):a),b.cloneElement(s,u)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xR=Symbol("radix.slottable");function Ij(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xR,t}function Hj(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xR}function Fj(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...u)=>{const h=l(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function Uj(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 $j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=$j.reduce((e,t)=>{const n=Qo(`Primitive.${t}`),r=b.forwardRef((s,l)=>{const{asChild:a,...u}=s,h=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...u,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function SR(e,t){e&&Si.flushSync(()=>e.dispatchEvent(t))}function oi(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 Wj(e,t=globalThis==null?void 0:globalThis.document){const n=oi(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 Vj="DismissableLayer",m_="dismissableLayer.update",qj="dismissableLayer.pointerDownOutside",Kj="dismissableLayer.focusOutside",oC,wR=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),La=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:a,onDismiss:u,...h}=e,d=b.useContext(wR),[p,m]=b.useState(null),_=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),S=ht(t,j=>m(j)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=p?w.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,O=Xj(j=>{const F=j.target,G=[...d.branches].some(P=>P.contains(F));!M||G||(s==null||s(j),a==null||a(j),j.defaultPrevented||u==null||u())},_),D=Zj(j=>{const F=j.target;[...d.branches].some(P=>P.contains(F))||(l==null||l(j),a==null||a(j),j.defaultPrevented||u==null||u())},_);return Wj(j=>{T===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},_),b.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(oC=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),lC(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=oC)}},[p,_,n,d]),b.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),lC())},[p,d]),b.useEffect(()=>{const j=()=>y({});return document.addEventListener(m_,j),()=>document.removeEventListener(m_,j)},[]),g.jsx(et.div,{...h,ref:S,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,O.onPointerDownCapture)})});La.displayName=Vj;var Gj="DismissableLayerBranch",Yj=b.forwardRef((e,t)=>{const n=b.useContext(wR),r=b.useRef(null),s=ht(t,r);return b.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),g.jsx(et.div,{...e,ref:s})});Yj.displayName=Gj;function Xj(e,t=globalThis==null?void 0:globalThis.document){const n=oi(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const l=u=>{if(u.target&&!r.current){let h=function(){CR(qj,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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zj(e,t=globalThis==null?void 0:globalThis.document){const n=oi(e),r=b.useRef(!1);return b.useEffect(()=>{const s=l=>{l.target&&!r.current&&CR(Kj,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lC(){const e=new CustomEvent(m_);document.dispatchEvent(e)}function CR(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?SR(s,l):s.dispatchEvent(l)}var av="focusScope.autoFocusOnMount",cv="focusScope.autoFocusOnUnmount",aC={bubbles:!1,cancelable:!0},Qj="FocusScope",Uu=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...a}=e,[u,h]=b.useState(null),d=oi(s),p=oi(l),m=b.useRef(null),_=ht(t,w=>h(w)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let w=function(R){if(y.paused||!u)return;const M=R.target;u.contains(M)?m.current=M:Zs(m.current,{select:!0})},C=function(R){if(y.paused||!u)return;const M=R.relatedTarget;M!==null&&(u.contains(M)||Zs(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const O of R)O.removedNodes.length>0&&Zs(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),T.disconnect()}}},[r,u,y.paused]),b.useEffect(()=>{if(u){uC.add(y);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(av,aC);u.addEventListener(av,d),u.dispatchEvent(k),k.defaultPrevented||(Jj(iz(kR(u)),{select:!0}),document.activeElement===w&&Zs(u))}return()=>{u.removeEventListener(av,d),setTimeout(()=>{const k=new CustomEvent(cv,aC);u.addEventListener(cv,p),u.dispatchEvent(k),k.defaultPrevented||Zs(w??document.body,{select:!0}),u.removeEventListener(cv,p),uC.remove(y)},0)}}},[u,d,p,y]);const S=b.useCallback(w=>{if(!n&&!r||y.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,M]=ez(T);R&&M?!w.shiftKey&&k===M?(w.preventDefault(),n&&Zs(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Zs(M,{select:!0})):k===T&&w.preventDefault()}},[n,r,y.paused]);return g.jsx(et.div,{tabIndex:-1,...a,ref:_,onKeyDown:S})});Uu.displayName=Qj;function Jj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function ez(e){const t=kR(e),n=cC(t,e),r=cC(t.reverse(),e);return[n,r]}function kR(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 cC(e,t){for(const n of e)if(!tz(n,{upTo:t}))return n}function tz(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 nz(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nz(e)&&t&&e.select()}}var uC=rz();function rz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dC(e,t),e.unshift(t)},remove(t){var n;e=dC(e,t),(n=e[0])==null||n.resume()}}}function dC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iz(e){return e.filter(t=>t.tagName!=="A")}var sz="Portal",ja=b.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,l]=b.useState(!1);Pn(()=>l(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?HL.createPortal(g.jsx(et.div,{...r,ref:t}),a):null});ja.displayName=sz;function oz(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Kr=e=>{const{present:t,children:n}=e,r=lz(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),l=ht(r.ref,az(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:l}):null};Kr.displayName="Presence";function lz(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),l=b.useRef("none"),a=e?"mounted":"unmounted",[u,h]=oz(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=Ch(r.current);l.current=u==="mounted"?d:"none"},[u]),Pn(()=>{const d=r.current,p=s.current;if(p!==e){const _=l.current,y=Ch(d);e?h("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Pn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=y=>{const w=Ch(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=y=>{y.target===t&&(l.current=Ch(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Ch(e){return(e==null?void 0:e.animationName)||"none"}function az(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 uv=0;function rp(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hC()),document.body.insertAdjacentElement("beforeend",e[1]??hC()),uv++,()=>{uv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uv--}},[])}function hC(){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 xi=function(){return xi=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},xi.apply(this,arguments)};function ER(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 cz(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var ef="right-scroll-bar-position",tf="width-before-scroll-bar",uz="with-scroll-bars-hidden",dz="--removed-body-scroll-bar-size";function dv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hz(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 fz=typeof window<"u"?b.useLayoutEffect:b.useEffect,fC=new WeakMap;function pz(e,t){var n=hz(null,function(r){return e.forEach(function(s){return dv(s,r)})});return fz(function(){var r=fC.get(n);if(r){var s=new Set(r),l=new Set(e),a=n.current;s.forEach(function(u){l.has(u)||dv(u,null)}),l.forEach(function(u){s.has(u)||dv(u,a)})}fC.set(n,e)},[e]),n}function mz(e){return e}function gz(e,t){t===void 0&&(t=mz);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(l){var a=t(l,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(l),a=n}var h=function(){var p=a;a=[],p.forEach(l)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),n}}}};return s}function vz(e){e===void 0&&(e={});var t=gz(null);return t.options=xi({async:!0,ssr:!1},e),t}var RR=function(e){var t=e.sideCar,n=ER(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,xi({},n))};RR.isSideCarExport=!0;function _z(e,t){return e.useMedium(t),RR}var TR=vz(),hv=function(){},ip=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:hv,onWheelCapture:hv,onTouchMoveCapture:hv}),s=r[0],l=r[1],a=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,_=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,M=ER(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=_,D=pz([n,t]),j=xi(xi({},M),s);return b.createElement(b.Fragment,null,p&&b.createElement(O,{sideCar:TR,removeScrollBar:d,shards:m,noRelative:y,noIsolation:S,inert:w,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),a?b.cloneElement(b.Children.only(u),xi(xi({},j),{ref:D})):b.createElement(T,xi({},j,{className:h,ref:D}),u))});ip.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ip.classNames={fullWidth:tf,zeroRight:ef};var yz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yz();return t&&e.setAttribute("nonce",t),e}function xz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bz())&&(xz(t,n),Sz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cz=function(){var e=wz();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MR=function(){var e=Cz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},kz={left:0,top:0,right:0,gap:0},fv=function(e){return parseInt(e||"",10)||0},Ez=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[fv(n),fv(r),fv(s)]},Rz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kz;var t=Ez(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])}},Tz=MR(),va="data-scroll-locked",Mz=function(e,t,n,r){var s=e.left,l=e.top,a=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
.`.concat(uz,` {
|
|
62
|
+
overflow: hidden `).concat(r,`;
|
|
63
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
body[`).concat(va,`] {
|
|
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(l,`px;
|
|
71
|
+
padding-right: `).concat(a,`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(ef,` {
|
|
79
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(tf,` {
|
|
83
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(ef," .").concat(ef,` {
|
|
87
|
+
right: 0 `).concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(tf," .").concat(tf,` {
|
|
91
|
+
margin-right: 0 `).concat(r,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
body[`).concat(va,`] {
|
|
95
|
+
`).concat(dz,": ").concat(u,`px;
|
|
96
|
+
}
|
|
97
|
+
`)},pC=function(){var e=parseInt(document.body.getAttribute(va)||"0",10);return isFinite(e)?e:0},Nz=function(){b.useEffect(function(){return document.body.setAttribute(va,(pC()+1).toString()),function(){var e=pC()-1;e<=0?document.body.removeAttribute(va):document.body.setAttribute(va,e.toString())}},[])},Az=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Nz();var l=b.useMemo(function(){return Rz(s)},[s]);return b.createElement(Tz,{styles:Mz(l,!t,s,n?"":"!important")})},g_=!1;if(typeof window<"u")try{var kh=Object.defineProperty({},"passive",{get:function(){return g_=!0,!0}});window.addEventListener("test",kh,kh),window.removeEventListener("test",kh,kh)}catch{g_=!1}var ea=g_?{passive:!1}:!1,Dz=function(e){return e.tagName==="TEXTAREA"},NR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Dz(e)&&n[t]==="visible")},Oz=function(e){return NR(e,"overflowY")},Lz=function(e){return NR(e,"overflowX")},mC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=AR(e,r);if(s){var l=DR(e,r),a=l[1],u=l[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},AR=function(e,t){return e==="v"?Oz(t):Lz(t)},DR=function(e,t){return e==="v"?jz(t):zz(t)},Pz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bz=function(e,t,n,r,s){var l=Pz(e,window.getComputedStyle(t).direction),a=l*r,u=n.target,h=t.contains(u),d=!1,p=a>0,m=0,_=0;do{if(!u)break;var y=DR(e,u),S=y[0],w=y[1],C=y[2],k=w-C-l*S;(S||k)&&AR(e,u)&&(m+=k,_+=S);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(d=!0),d},Eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gC=function(e){return[e.deltaX,e.deltaY]},vC=function(e){return e&&"current"in e?e.current:e},Iz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hz=function(e){return`
|
|
98
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
+
`)},Fz=0,ta=[];function Uz(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(Fz++)[0],l=b.useState(MR)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=cz([e.lockRef.current],(e.shards||[]).map(vC),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var k=Eh(w),T=n.current,R="deltaX"in w?w.deltaX:T[0]-k[0],M="deltaY"in w?w.deltaY:T[1]-k[1],O,D=w.target,j=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in w&&j==="h"&&D.type==="range")return!1;var F=window.getSelection(),G=F&&F.anchorNode,P=G?G===D||G.contains(D):!1;if(P)return!1;var W=mC(j,D);if(!W)return!0;if(W?O=j:(O=j==="v"?"h":"v",W=mC(j,D)),!W)return!1;if(!r.current&&"changedTouches"in w&&(R||M)&&(r.current=O),!O)return!0;var I=r.current||O;return Bz(I,C,w,I==="h"?R:M)},[]),h=b.useCallback(function(w){var C=w;if(!(!ta.length||ta[ta.length-1]!==l)){var k="deltaY"in C?gC(C):Eh(C),T=t.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&Iz(O.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(a.current.shards||[]).map(vC).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=R.length>0?u(C,R[0]):!a.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),d=b.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:$z(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(M){return M!==R})},1)},[]),p=b.useCallback(function(w){n.current=Eh(w),r.current=void 0},[]),m=b.useCallback(function(w){d(w.type,gC(w),w.target,u(w,e.lockRef.current))},[]),_=b.useCallback(function(w){d(w.type,Eh(w),w.target,u(w,e.lockRef.current))},[]);b.useEffect(function(){return ta.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",h,ea),document.addEventListener("touchmove",h,ea),document.addEventListener("touchstart",p,ea),function(){ta=ta.filter(function(w){return w!==l}),document.removeEventListener("wheel",h,ea),document.removeEventListener("touchmove",h,ea),document.removeEventListener("touchstart",p,ea)}},[]);var y=e.removeScrollBar,S=e.inert;return b.createElement(b.Fragment,null,S?b.createElement(l,{styles:Hz(s)}):null,y?b.createElement(Az,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $z(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Wz=_z(TR,Uz);var $u=b.forwardRef(function(e,t){return b.createElement(ip,xi({},e,{ref:t,sideCar:Wz}))});$u.classNames=ip.classNames;var Vz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},na=new WeakMap,Rh=new WeakMap,Th={},pv=0,OR=function(e){return e&&(e.host||OR(e.parentNode))},qz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=OR(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})},Kz=function(e,t,n,r){var s=qz(t,Array.isArray(e)?e:[e]);Th[n]||(Th[n]=new WeakMap);var l=Th[n],a=[],u=new Set,h=new Set(s),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};s.forEach(d);var p=function(m){!m||h.has(m)||Array.prototype.forEach.call(m.children,function(_){if(u.has(_))p(_);else try{var y=_.getAttribute(r),S=y!==null&&y!=="false",w=(na.get(_)||0)+1,C=(l.get(_)||0)+1;na.set(_,w),l.set(_,C),a.push(_),w===1&&S&&Rh.set(_,!0),C===1&&_.setAttribute(n,"true"),S||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return p(t),u.clear(),pv++,function(){a.forEach(function(m){var _=na.get(m)-1,y=l.get(m)-1;na.set(m,_),l.set(m,y),_||(Rh.has(m)||m.removeAttribute(r),Rh.delete(m)),y||m.removeAttribute(n)}),pv--,pv||(na=new WeakMap,na=new WeakMap,Rh=new WeakMap,Th={})}},sp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Vz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Kz(r,s,n,"aria-hidden")):function(){return null}},op="Dialog",[LR]=ms(op),[Gz,di]=LR(op),jR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,u=b.useRef(null),h=b.useRef(null),[d,p]=wa({prop:r,defaultProp:s??!1,onChange:l,caller:op});return g.jsx(Gz,{scope:t,triggerRef:u,contentRef:h,contentId:cs(),titleId:cs(),descriptionId:cs(),open:d,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:a,children:n})};jR.displayName=op;var zR="DialogTrigger",Yz=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(zR,n),l=ht(t,s.triggerRef);return g.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":cb(s.open),...r,ref:l,onClick:Re(e.onClick,s.onOpenToggle)})});Yz.displayName=zR;var lb="DialogPortal",[Xz,PR]=LR(lb,{forceMount:void 0}),BR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=di(lb,t);return g.jsx(Xz,{scope:t,forceMount:n,children:b.Children.map(r,a=>g.jsx(Kr,{present:n||l.open,children:g.jsx(ja,{asChild:!0,container:s,children:a})}))})};BR.displayName=lb;var xf="DialogOverlay",IR=b.forwardRef((e,t)=>{const n=PR(xf,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=di(xf,e.__scopeDialog);return l.modal?g.jsx(Kr,{present:r||l.open,children:g.jsx(Qz,{...s,ref:t})}):null});IR.displayName=xf;var Zz=Qo("DialogOverlay.RemoveScroll"),Qz=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(xf,n);return g.jsx($u,{as:Zz,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(et.div,{"data-state":cb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jo="DialogContent",HR=b.forwardRef((e,t)=>{const n=PR(Jo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=di(Jo,e.__scopeDialog);return g.jsx(Kr,{present:r||l.open,children:l.modal?g.jsx(Jz,{...s,ref:t}):g.jsx(e6,{...s,ref:t})})});HR.displayName=Jo;var Jz=b.forwardRef((e,t)=>{const n=di(Jo,e.__scopeDialog),r=b.useRef(null),s=ht(t,n.contentRef,r);return b.useEffect(()=>{const l=r.current;if(l)return sp(l)},[]),g.jsx(FR,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),e6=b.forwardRef((e,t)=>{const n=di(Jo,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return g.jsx(FR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),FR=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...a}=e,u=di(Jo,n),h=b.useRef(null),d=ht(t,h);return rp(),g.jsxs(g.Fragment,{children:[g.jsx(Uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:g.jsx(La,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":cb(u.open),...a,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(t6,{titleId:u.titleId}),g.jsx(r6,{contentRef:h,descriptionId:u.descriptionId})]})]})}),ab="DialogTitle",UR=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(ab,n);return g.jsx(et.h2,{id:s.titleId,...r,ref:t})});UR.displayName=ab;var $R="DialogDescription",WR=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di($R,n);return g.jsx(et.p,{id:s.descriptionId,...r,ref:t})});WR.displayName=$R;var VR="DialogClose",qR=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(VR,n);return g.jsx(et.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});qR.displayName=VR;function cb(e){return e?"open":"closed"}var KR="DialogTitleWarning",[Vee,GR]=Aj(KR,{contentName:Jo,titleName:ab,docsSlug:"dialog"}),t6=({titleId:e})=>{const t=GR(KR),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},n6="DialogDescriptionWarning",r6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GR(n6).contentName}}.`;return b.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},i6=jR,s6=BR,YR=IR,XR=HR,o6=UR,l6=WR,a6=qR;/**
|
|
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 c6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_C=e=>{const t=u6(e);return t.charAt(0).toUpperCase()+t.slice(1)},ZR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),d6=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 h6={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 f6=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:a,...u},h)=>b.createElement("svg",{ref:h,...h6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZR("lucide",s),...!l&&!d6(u)&&{"aria-hidden":"true"},...u},[...a.map(([d,p])=>b.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
|
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 Me=(e,t)=>{const n=b.forwardRef(({className:r,...s},l)=>b.createElement(f6,{ref:l,iconNode:t,className:ZR(`lucide-${c6(_C(e))}`,`lucide-${e}`,r),...s}));return n.displayName=_C(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 p6=[["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"}]],m6=Me("archive",p6);/**
|
|
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 g6=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],v6=Me("arrow-down-to-line",g6);/**
|
|
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 _6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],y6=Me("arrow-down",_6);/**
|
|
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 b6=[["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"}]],x6=Me("arrow-left-right",b6);/**
|
|
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 S6=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],w6=Me("arrow-up",S6);/**
|
|
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 C6=[["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"}]],k6=Me("asterisk",C6);/**
|
|
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 E6=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]],R6=Me("book-text",E6);/**
|
|
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 T6=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],$o=Me("box",T6);/**
|
|
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 M6=[["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"}]],mv=Me("brain",M6);/**
|
|
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 N6=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],A6=Me("check-check",N6);/**
|
|
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 D6=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],O6=Me("check-line",D6);/**
|
|
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 L6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ao=Me("check",L6);/**
|
|
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 j6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ub=Me("chevron-down",j6);/**
|
|
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 z6=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],P6=Me("chevron-left",z6);/**
|
|
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 B6=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ds=Me("chevron-right",B6);/**
|
|
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 I6=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],H6=Me("chevron-up",I6);/**
|
|
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 F6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],U6=Me("circle-slash",F6);/**
|
|
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 $6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],W6=Me("circle",$6);/**
|
|
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 V6=[["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"}]],q6=Me("cloud-download",V6);/**
|
|
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 K6=[["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"}]],yC=Me("code-xml",K6);/**
|
|
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 G6=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],QR=Me("code",G6);/**
|
|
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 Y6=[["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"}]],X6=Me("command",Y6);/**
|
|
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 Z6=[["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"}]],lp=Me("copy",Z6);/**
|
|
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 Q6=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],J6=Me("corner-down-left",Q6);/**
|
|
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 eP=[["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"}]],tP=Me("eraser",eP);/**
|
|
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 nP=[["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"}]],rP=Me("file-pen",nP);/**
|
|
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 iP=[["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"}]],sP=Me("file-plus-corner",iP);/**
|
|
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 oP=[["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"}]],lP=Me("file",oP);/**
|
|
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 aP=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],pu=Me("flower",aP);/**
|
|
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 cP=[["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"}]],JR=Me("folder-open",cP);/**
|
|
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 uP=[["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"}]],dP=Me("folder",uP);/**
|
|
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 hP=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Mh=Me("gauge",hP);/**
|
|
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 fP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],pP=Me("info",fP);/**
|
|
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 mP=[["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"}]],gP=Me("list-checks",mP);/**
|
|
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 vP=[["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"}]],Sf=Me("list-todo",vP);/**
|
|
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 _P=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Mi=Me("loader-circle",_P);/**
|
|
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 yP=[["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"}]],bC=Me("lock-open",yP);/**
|
|
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 bP=[["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"}]],xC=Me("map",bP);/**
|
|
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 xP=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],db=Me("menu",xP);/**
|
|
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 SP=[["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"}]],eT=Me("message-circle-question-mark",SP);/**
|
|
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 wP=[["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"}]],CP=Me("message-square-quote",wP);/**
|
|
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 kP=[["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"}]],tT=Me("minimize",kP);/**
|
|
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 EP=[["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"}]],hb=Me("monitor",EP);/**
|
|
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 RP=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],TP=Me("moon",RP);/**
|
|
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 MP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],v_=Me("panel-left",MP);/**
|
|
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 NP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],AP=Me("panel-right",NP);/**
|
|
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 DP=[["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"}]],nT=Me("pencil",DP);/**
|
|
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 OP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fb=Me("plus",OP);/**
|
|
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 LP=[["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"}]],jP=Me("refresh-cw",LP);/**
|
|
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 zP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],gv=Me("search",zP);/**
|
|
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 PP=[["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"}]],BP=Me("send",PP);/**
|
|
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 IP=[["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"}]],HP=Me("settings",IP);/**
|
|
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 FP=[["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"}]],UP=Me("settings-2",FP);/**
|
|
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 $P=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],WP=Me("slash",$P);/**
|
|
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 VP=[["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"}]],rT=Me("sparkles",VP);/**
|
|
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 qP=[["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"}]],SC=Me("square-menu",qP);/**
|
|
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 KP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],wC=Me("square-minus",KP);/**
|
|
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 GP=[["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"}]],pb=Me("square-pen",GP);/**
|
|
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 YP=[["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"}]],XP=Me("square-x",YP);/**
|
|
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 ZP=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],QP=Me("sun",ZP);/**
|
|
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 JP=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],mb=Me("terminal",JP);/**
|
|
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 eB=[["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"}]],tB=Me("toy-brick",eB);/**
|
|
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 nB=[["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"}]],rB=Me("trash-2",nB);/**
|
|
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 iB=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],gb=Me("user-round",iB);/**
|
|
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 sB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],za=Me("x",sB),ku="data-focus-fallback-ignore",iT="data-allow-focus-retain",wf="kanna:restore-chat-input-focus",vb="data-chat-input",Cf="data-chat-selection-zone";function Ko(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function sT(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:Ko(e,iT):!1}function oB(e){const t=e;return t!=null&&t.matches?sT(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:Ko(e,iT):!1}function CC(e){return!!e.querySelector(`[${ku}][data-state='open']`)}function lB(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function aB(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${vb}]`)).filter(a=>!a.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,l=n[s];return l?(l.focus({preventScroll:!0}),!0):!1}function kC(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||Ko(t,vb)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:l,root:a,hasActiveSelection:u}=e,h=l??s;return!a||!h||!a.contains(h)||Ko(h,ku)||Ko(t,ku)||u&&(Ko(s,Cf)||Ko(h,Cf))||sT(t)?"none":t&&t===h?"restore":oB(t)?"none":"restore"}const oT=i6,cB=s6,lT=b.forwardRef(({className:e,...t},n)=>g.jsx(YR,{ref:n,className:ye("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}));lT.displayName=YR.displayName;const uB={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},_b=b.forwardRef(({className:e,children:t,size:n="md",...r},s)=>g.jsxs(cB,{children:[g.jsx(lT,{}),g.jsxs(XR,{ref:s,[ku]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event(wf)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},className:ye("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 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",uB[n],e),...r,children:[t,g.jsxs(a6,{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:[g.jsx(za,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_b.displayName=XR.displayName;function aT({className:e,...t}){return g.jsx(o6,{className:ye("text-lg font-medium leading-none tracking-tight",e),...t})}function dB({className:e,...t}){return g.jsx(l6,{className:ye("text-sm text-muted-foreground",e),...t})}function cT({className:e,...t}){return g.jsx("div",{className:ye("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function uT({className:e,...t}){return g.jsx("div",{className:ye("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const io=b.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{ref:r,type:t,className:ye("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}));io.displayName="Input";const dT=b.createContext(null);function hB({children:e}){const[t,n]=b.useState(null),[r,s]=b.useState(""),l=b.useRef(null);b.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var y,S;(y=l.current)==null||y.focus(),(S=l.current)==null||S.select()},0))},[t]);const a=b.useCallback(()=>{n(null),s("")},[]),u=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),a())},[a,t]),h=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),a())},[a,t,r]),d=b.useCallback(y=>new Promise(S=>{n({kind:"confirm",options:y,resolve:S})}),[]),p=b.useCallback(y=>new Promise(S=>{n({kind:"prompt",options:y,resolve:S})}),[]),m=b.useCallback(y=>new Promise(S=>{n({kind:"alert",options:y,resolve:S})}),[]),_=b.useMemo(()=>({confirm:d,prompt:p,alert:m}),[m,d,p]);return g.jsxs(dT.Provider,{value:_,children:[e,g.jsx(oT,{open:t!==null,onOpenChange:y=>{y||!t||u()},children:g.jsx(_b,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!t||t.kind!=="confirm"||(y.preventDefault(),h())},children:t?g.jsxs(g.Fragment,{children:[g.jsxs(cT,{className:"space-y-4",children:[g.jsx(aT,{children:t.options.title}),t.options.description?g.jsx(dB,{children:t.options.description}):null,t.kind==="prompt"?g.jsx(io,{ref:l,type:"text",value:r,onChange:y=>s(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),g.jsxs(uT,{children:[g.jsx(rt,{variant:"ghost",size:"sm",onClick:u,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),g.jsx(rt,{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 fB(){const e=b.useContext(dT);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const pB=["top","right","bottom","left"],co=Math.min,Sr=Math.max,kf=Math.round,Nh=Math.floor,Ri=e=>({x:e,y:e}),mB={left:"right",right:"left",bottom:"top",top:"bottom"};function __(e,t,n){return Sr(e,co(t,n))}function hs(e,t){return typeof e=="function"?e(t):e}function fs(e){return e.split("-")[0]}function Pa(e){return e.split("-")[1]}function yb(e){return e==="x"?"y":"x"}function bb(e){return e==="y"?"height":"width"}function wi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function xb(e){return yb(wi(e))}function gB(e,t,n){n===void 0&&(n=!1);const r=Pa(e),s=xb(e),l=bb(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Ef(a)),[a,Ef(a)]}function vB(e){const t=Ef(e);return[y_(e),t,y_(t)]}function y_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const EC=["left","right"],RC=["right","left"],_B=["top","bottom"],yB=["bottom","top"];function bB(e,t,n){switch(e){case"top":case"bottom":return n?t?RC:EC:t?EC:RC;case"left":case"right":return t?_B:yB;default:return[]}}function xB(e,t,n,r){const s=Pa(e);let l=bB(fs(e),n==="start",r);return s&&(l=l.map(a=>a+"-"+s),t&&(l=l.concat(l.map(y_)))),l}function Ef(e){const t=fs(e);return mB[t]+e.slice(t.length)}function SB(e){return{top:0,right:0,bottom:0,left:0,...e}}function hT(e){return typeof e!="number"?SB(e):{top:e,right:e,bottom:e,left:e}}function Rf(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 TC(e,t,n){let{reference:r,floating:s}=e;const l=wi(t),a=xb(t),u=bb(a),h=fs(t),d=l==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let y;switch(h){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}switch(Pa(t)){case"start":y[a]-=_*(n&&d?-1:1);break;case"end":y[a]+=_*(n&&d?-1:1);break}return y}async function wB(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:a,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:y=0}=hs(t,e),S=hT(y),C=u[_?m==="floating"?"reference":"floating":m],k=Rf(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:h})),T=m==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),M=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},O=Rf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:h}):T);return{top:(k.top-O.top+S.top)/M.y,bottom:(O.bottom-k.bottom+S.bottom)/M.y,left:(k.left-O.left+S.left)/M.x,right:(O.right-k.right+S.right)/M.x}}const CB=50,kB=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:wB},h=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=TC(d,r,h),_=r,y=0;const S={};for(let w=0;w<l.length;w++){const C=l[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:M,data:O,reset:D}=await T({x:p,y:m,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:d,platform:u,elements:{reference:e,floating:t}});p=R??p,m=M??m,S[k]={...S[k],...O},D&&y<CB&&(y++,typeof D=="object"&&(D.placement&&(_=D.placement),D.rects&&(d=D.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:p,y:m}=TC(d,_,h)),w=-1)}return{x:p,y:m,placement:_,strategy:s,middlewareData:S}},EB=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:a,elements:u,middlewareData:h}=t,{element:d,padding:p=0}=hs(e,t)||{};if(d==null)return{};const m=hT(p),_={x:n,y:r},y=xb(s),S=bb(y),w=await a.getDimensions(d),C=y==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=l.reference[S]+l.reference[y]-_[y]-l.floating[S],O=_[y]-l.reference[y],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let j=D?D[R]:0;(!j||!await(a.isElement==null?void 0:a.isElement(D)))&&(j=u.floating[R]||l.floating[S]);const F=M/2-O/2,G=j/2-w[S]/2-1,P=co(m[k],G),W=co(m[T],G),I=P,$=j-w[S]-W,U=j/2-w[S]/2+F,H=__(I,U,$),B=!h.arrow&&Pa(s)!=null&&U!==H&&l.reference[S]/2-(U<I?P:W)-w[S]/2<0,q=B?U<I?U-I:U-$:0;return{[y]:_[y]+q,data:{[y]:H,centerOffset:U-H-q,...B&&{alignmentOffset:q}},reset:B}}}),RB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:a,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=hs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const k=fs(s),T=wi(u),R=fs(u)===u,M=await(h.isRTL==null?void 0:h.isRTL(d.floating)),O=_||(R||!w?[Ef(u)]:vB(u)),D=S!=="none";!_&&D&&O.push(...xB(u,w,S,M));const j=[u,...O],F=await h.detectOverflow(t,C),G=[];let P=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&G.push(F[k]),m){const U=gB(s,a,M);G.push(F[U[0]],F[U[1]])}if(P=[...P,{placement:s,overflows:G}],!G.every(U=>U<=0)){var W,I;const U=(((W=l.flip)==null?void 0:W.index)||0)+1,H=j[U];if(H&&(!(m==="alignment"?T!==wi(H):!1)||P.every(V=>wi(V.placement)===T?V.overflows[0]>0:!0)))return{data:{index:U,overflows:P},reset:{placement:H}};let B=(I=P.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:I.placement;if(!B)switch(y){case"bestFit":{var $;const q=($=P.filter(V=>{if(D){const Z=wi(V.placement);return Z===T||Z==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Z=>Z>0).reduce((Z,N)=>Z+N,0)]).sort((V,Z)=>V[1]-Z[1])[0])==null?void 0:$[0];q&&(B=q);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function MC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function NC(e){return pB.some(t=>e[t]>=0)}const TB=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...l}=hs(e,t);switch(s){case"referenceHidden":{const a=await r.detectOverflow(t,{...l,elementContext:"reference"}),u=MC(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:NC(u)}}}case"escaped":{const a=await r.detectOverflow(t,{...l,altBoundary:!0}),u=MC(a,n.floating);return{data:{escapedOffsets:u,escaped:NC(u)}}}default:return{}}}}},fT=new Set(["left","top"]);async function MB(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=fs(n),u=Pa(n),h=wi(n)==="y",d=fT.has(a)?-1:1,p=l&&h?-1:1,m=hs(t,e);let{mainAxis:_,crossAxis:y,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof S=="number"&&(y=u==="end"?S*-1:S),h?{x:y*p,y:_*d}:{x:_*d,y:y*p}}const NB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:a,middlewareData:u}=t,h=await MB(t,e);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:a}}}}},AB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:l}=t,{mainAxis:a=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...d}=hs(e,t),p={x:n,y:r},m=await l.detectOverflow(t,d),_=wi(fs(s)),y=yb(_);let S=p[y],w=p[_];if(a){const k=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=S+m[k],M=S-m[T];S=__(R,S,M)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+m[k],M=w-m[T];w=__(R,w,M)}const C=h.fn({...t,[y]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:a,[_]:u}}}}}},DB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:a}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=hs(e,t),p={x:n,y:r},m=wi(s),_=yb(m);let y=p[_],S=p[m];const w=hs(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const R=_==="y"?"height":"width",M=l.reference[_]-l.floating[R]+C.mainAxis,O=l.reference[_]+l.reference[R]-C.mainAxis;y<M?y=M:y>O&&(y=O)}if(d){var k,T;const R=_==="y"?"width":"height",M=fT.has(fs(s)),O=l.reference[m]-l.floating[R]+(M&&((k=a.offset)==null?void 0:k[m])||0)+(M?0:C.crossAxis),D=l.reference[m]+l.reference[R]+(M?0:((T=a.offset)==null?void 0:T[m])||0)-(M?C.crossAxis:0);S<O?S=O:S>D&&(S=D)}return{[_]:y,[m]:S}}}},OB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:a,elements:u}=t,{apply:h=()=>{},...d}=hs(e,t),p=await a.detectOverflow(t,d),m=fs(s),_=Pa(s),y=wi(s)==="y",{width:S,height:w}=l.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=_===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(k=m,C=_==="end"?"top":"bottom");const T=w-p.top-p.bottom,R=S-p.left-p.right,M=co(w-p[C],T),O=co(S-p[k],R),D=!t.middlewareData.shift;let j=M,F=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=T),D&&!_){const P=Sr(p.left,0),W=Sr(p.right,0),I=Sr(p.top,0),$=Sr(p.bottom,0);y?F=S-2*(P!==0||W!==0?P+W:Sr(p.left,p.right)):j=w-2*(I!==0||$!==0?I+$:Sr(p.top,p.bottom))}await h({...t,availableWidth:F,availableHeight:j});const G=await a.getDimensions(u.floating);return S!==G.width||w!==G.height?{reset:{rects:!0}}:{}}}};function ap(){return typeof window<"u"}function Ba(e){return pT(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Di(e){var t;return(t=(pT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pT(e){return ap()?e instanceof Node||e instanceof wr(e).Node:!1}function li(e){return ap()?e instanceof Element||e instanceof wr(e).Element:!1}function gs(e){return ap()?e instanceof HTMLElement||e instanceof wr(e).HTMLElement:!1}function AC(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Wu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function LB(e){return/^(table|td|th)$/.test(Ba(e))}function cp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const jB=/transform|translate|scale|rotate|perspective|filter/,zB=/paint|layout|strict|content/,Bo=e=>!!e&&e!=="none";let vv;function Sb(e){const t=li(e)?ai(e):e;return Bo(t.transform)||Bo(t.translate)||Bo(t.scale)||Bo(t.rotate)||Bo(t.perspective)||!wb()&&(Bo(t.backdropFilter)||Bo(t.filter))||jB.test(t.willChange||"")||zB.test(t.contain||"")}function PB(e){let t=uo(e);for(;gs(t)&&!Ca(t);){if(Sb(t))return t;if(cp(t))return null;t=uo(t)}return null}function wb(){return vv==null&&(vv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vv}function Ca(e){return/^(html|body|#document)$/.test(Ba(e))}function ai(e){return wr(e).getComputedStyle(e)}function up(e){return li(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||AC(e)&&e.host||Di(e);return AC(t)?t.host:t}function mT(e){const t=uo(e);return Ca(t)?e.ownerDocument?e.ownerDocument.body:e.body:gs(t)&&Wu(t)?t:mT(t)}function Eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=mT(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),a=wr(s);if(l){const u=b_(a);return t.concat(a,a.visualViewport||[],Wu(s)?s:[],u&&n?Eu(u):[])}else return t.concat(s,Eu(s,[],n))}function b_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gT(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=gs(e),l=s?e.offsetWidth:n,a=s?e.offsetHeight:r,u=kf(n)!==l||kf(r)!==a;return u&&(n=l,r=a),{width:n,height:r,$:u}}function Cb(e){return li(e)?e:e.contextElement}function _a(e){const t=Cb(e);if(!gs(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=gT(t);let a=(l?kf(n.width):n.width)/r,u=(l?kf(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const BB=Ri(0);function vT(e){const t=wr(e);return!wb()||!t.visualViewport?BB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function el(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=Cb(e);let a=Ri(1);t&&(r?li(r)&&(a=_a(r)):a=_a(e));const u=IB(l,n,r)?vT(l):Ri(0);let h=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,p=s.width/a.x,m=s.height/a.y;if(l){const _=wr(l),y=r&&li(r)?wr(r):r;let S=_,w=b_(S);for(;w&&r&&y!==S;){const C=_a(w),k=w.getBoundingClientRect(),T=ai(w),R=k.left+(w.clientLeft+parseFloat(T.paddingLeft))*C.x,M=k.top+(w.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,d*=C.y,p*=C.x,m*=C.y,h+=R,d+=M,S=wr(w),w=b_(S)}}return Rf({width:p,height:m,x:h,y:d})}function dp(e,t){const n=up(e).scrollLeft;return t?t.left+n:el(Di(e)).left+n}function _T(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function HB(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",a=Di(r),u=t?cp(t.floating):!1;if(r===a||u&&l)return n;let h={scrollLeft:0,scrollTop:0},d=Ri(1);const p=Ri(0),m=gs(r);if((m||!m&&!l)&&((Ba(r)!=="body"||Wu(a))&&(h=up(r)),m)){const y=el(r);d=_a(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const _=a&&!m&&!l?_T(a,h):Ri(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+p.x+_.x,y:n.y*d.y-h.scrollTop*d.y+p.y+_.y}}function FB(e){return Array.from(e.getClientRects())}function UB(e){const t=Di(e),n=up(e),r=e.ownerDocument.body,s=Sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+dp(e);const u=-n.scrollTop;return ai(r).direction==="rtl"&&(a+=Sr(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:a,y:u}}const DC=25;function $B(e,t){const n=wr(e),r=Di(e),s=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,u=0,h=0;if(s){l=s.width,a=s.height;const p=wb();(!p||p&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=dp(r);if(d<=0){const p=r.ownerDocument,m=p.body,_=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-y);S<=DC&&(l-=S)}else d<=DC&&(l+=d);return{width:l,height:a,x:u,y:h}}function WB(e,t){const n=el(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=gs(e)?_a(e):Ri(1),a=e.clientWidth*l.x,u=e.clientHeight*l.y,h=s*l.x,d=r*l.y;return{width:a,height:u,x:h,y:d}}function OC(e,t,n){let r;if(t==="viewport")r=$B(e,n);else if(t==="document")r=UB(Di(e));else if(li(t))r=WB(t,n);else{const s=vT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Rf(r)}function yT(e,t){const n=uo(e);return n===t||!li(n)||Ca(n)?!1:ai(n).position==="fixed"||yT(n,t)}function VB(e,t){const n=t.get(e);if(n)return n;let r=Eu(e,[],!1).filter(u=>li(u)&&Ba(u)!=="body"),s=null;const l=ai(e).position==="fixed";let a=l?uo(e):e;for(;li(a)&&!Ca(a);){const u=ai(a),h=Sb(a);!h&&u.position==="fixed"&&(s=null),(l?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Wu(a)&&!h&&yT(e,a))?r=r.filter(p=>p!==a):s=u,a=uo(a)}return t.set(e,r),r}function qB(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?cp(t)?[]:VB(t,this._c):[].concat(n),r],u=OC(t,a[0],s);let h=u.top,d=u.right,p=u.bottom,m=u.left;for(let _=1;_<a.length;_++){const y=OC(t,a[_],s);h=Sr(y.top,h),d=co(y.right,d),p=co(y.bottom,p),m=Sr(y.left,m)}return{width:d-m,height:p-h,x:m,y:h}}function KB(e){const{width:t,height:n}=gT(e);return{width:t,height:n}}function GB(e,t,n){const r=gs(t),s=Di(t),l=n==="fixed",a=el(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const h=Ri(0);function d(){h.x=dp(s)}if(r||!r&&!l)if((Ba(t)!=="body"||Wu(s))&&(u=up(t)),r){const y=el(t,!0,l,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else s&&d();l&&!r&&s&&d();const p=s&&!r&&!l?_T(s,u):Ri(0),m=a.left+u.scrollLeft-h.x-p.x,_=a.top+u.scrollTop-h.y-p.y;return{x:m,y:_,width:a.width,height:a.height}}function _v(e){return ai(e).position==="static"}function LC(e,t){if(!gs(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Di(e)===n&&(n=n.ownerDocument.body),n}function bT(e,t){const n=wr(e);if(cp(e))return n;if(!gs(e)){let s=uo(e);for(;s&&!Ca(s);){if(li(s)&&!_v(s))return s;s=uo(s)}return n}let r=LC(e,t);for(;r&&LB(r)&&_v(r);)r=LC(r,t);return r&&Ca(r)&&_v(r)&&!Sb(r)?n:r||PB(e)||n}const YB=async function(e){const t=this.getOffsetParent||bT,n=this.getDimensions,r=await n(e.floating);return{reference:GB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XB(e){return ai(e).direction==="rtl"}const ZB={convertOffsetParentRelativeRectToViewportRelativeRect:HB,getDocumentElement:Di,getClippingRect:qB,getOffsetParent:bT,getElementRects:YB,getClientRects:FB,getDimensions:KB,getScale:_a,isElement:li,isRTL:XB};function xT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QB(e,t){let n=null,r;const s=Di(e);function l(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),l();const d=e.getBoundingClientRect(),{left:p,top:m,width:_,height:y}=d;if(u||t(),!_||!y)return;const S=Nh(m),w=Nh(s.clientWidth-(p+_)),C=Nh(s.clientHeight-(m+y)),k=Nh(p),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:Sr(0,co(1,h))||1};let M=!0;function O(D){const j=D[0].intersectionRatio;if(j!==h){if(!M)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!xT(d,e.getBoundingClientRect())&&a(),M=!1}try{n=new IntersectionObserver(O,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,R)}n.observe(e)}return a(!0),l}function JB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=Cb(e),p=s||l?[...d?Eu(d):[],...t?Eu(t):[]]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),l&&k.addEventListener("resize",n)});const m=d&&u?QB(d,n):null;let _=-1,y=null;a&&(y=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let S,w=h?el(e):null;h&&C();function C(){const k=el(e);w&&!xT(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;p.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),m==null||m(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(S)}}const eI=NB,tI=AB,nI=RB,rI=OB,iI=TB,jC=EB,sI=DB,oI=(e,t,n)=>{const r=new Map,s={platform:ZB,...n},l={...s.platform,_c:r};return kB(e,t,{...s,platform:l})};var lI=typeof document<"u",aI=function(){},nf=lI?b.useLayoutEffect:aI;function Tf(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(!Tf(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 l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!Tf(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function ST(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zC(e,t){const n=ST(e);return Math.round(t*n)/n}function yv(e){const t=b.useRef(e);return nf(()=>{t.current=e}),t}function cI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:a}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[p,m]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,y]=b.useState(r);Tf(_,r)||y(r);const[S,w]=b.useState(null),[C,k]=b.useState(null),T=b.useCallback(V=>{V!==D.current&&(D.current=V,w(V))},[]),R=b.useCallback(V=>{V!==j.current&&(j.current=V,k(V))},[]),M=l||S,O=a||C,D=b.useRef(null),j=b.useRef(null),F=b.useRef(p),G=h!=null,P=yv(h),W=yv(s),I=yv(d),$=b.useCallback(()=>{if(!D.current||!j.current)return;const V={placement:t,strategy:n,middleware:_};W.current&&(V.platform=W.current),oI(D.current,j.current,V).then(Z=>{const N={...Z,isPositioned:I.current!==!1};U.current&&!Tf(F.current,N)&&(F.current=N,Si.flushSync(()=>{m(N)}))})},[_,t,n,W,I]);nf(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,m(V=>({...V,isPositioned:!1})))},[d]);const U=b.useRef(!1);nf(()=>(U.current=!0,()=>{U.current=!1}),[]),nf(()=>{if(M&&(D.current=M),O&&(j.current=O),M&&O){if(P.current)return P.current(M,O,$);$()}},[M,O,$,P,G]);const H=b.useMemo(()=>({reference:D,floating:j,setReference:T,setFloating:R}),[T,R]),B=b.useMemo(()=>({reference:M,floating:O}),[M,O]),q=b.useMemo(()=>{const V={position:n,left:0,top:0};if(!B.floating)return V;const Z=zC(B.floating,p.x),N=zC(B.floating,p.y);return u?{...V,transform:"translate("+Z+"px, "+N+"px)",...ST(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:N}},[n,u,B.floating,p.x,p.y]);return b.useMemo(()=>({...p,update:$,refs:H,elements:B,floatingStyles:q}),[p,$,H,B,q])}const uI=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?jC({element:r.current,padding:s}).fn(n):{}:r?jC({element:r,padding:s}).fn(n):{}}}},dI=(e,t)=>{const n=eI(e);return{name:n.name,fn:n.fn,options:[e,t]}},hI=(e,t)=>{const n=tI(e);return{name:n.name,fn:n.fn,options:[e,t]}},fI=(e,t)=>({fn:sI(e).fn,options:[e,t]}),pI=(e,t)=>{const n=nI(e);return{name:n.name,fn:n.fn,options:[e,t]}},mI=(e,t)=>{const n=rI(e);return{name:n.name,fn:n.fn,options:[e,t]}},gI=(e,t)=>{const n=iI(e);return{name:n.name,fn:n.fn,options:[e,t]}},vI=(e,t)=>{const n=uI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var _I="Arrow",wT=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return g.jsx(et.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});wT.displayName=_I;var yI=wT;function bI(e){const[t,n]=b.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let a,u;if("borderBoxSize"in l){const h=l.borderBoxSize,d=Array.isArray(h)?h[0]:h;a=d.inlineSize,u=d.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kb="Popper",[CT,po]=ms(kb),[xI,kT]=CT(kb),ET=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return g.jsx(xI,{scope:t,anchor:r,onAnchorChange:s,children:n})};ET.displayName=kb;var RT="PopperAnchor",TT=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=kT(RT,n),a=b.useRef(null),u=ht(t,a),h=b.useRef(null);return b.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||a.current,d!==h.current&&l.onAnchorChange(h.current)}),r?null:g.jsx(et.div,{...s,ref:u})});TT.displayName=RT;var Eb="PopperContent",[SI,wI]=CT(Eb),MT=b.forwardRef((e,t)=>{var J,ge,ie,ce,we,Se;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:y="optimized",onPlaced:S,...w}=e,C=kT(Eb,n),[k,T]=b.useState(null),R=ht(t,ke=>T(ke)),[M,O]=b.useState(null),D=bI(M),j=(D==null?void 0:D.width)??0,F=(D==null?void 0:D.height)??0,G=r+(l!=="center"?"-"+l:""),P=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},W=Array.isArray(d)?d:[d],I=W.length>0,$={padding:P,boundary:W.filter(kI),altBoundary:I},{refs:U,floatingStyles:H,placement:B,isPositioned:q,middlewareData:V}=cI({strategy:"fixed",placement:G,whileElementsMounted:(...ke)=>JB(...ke,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[dI({mainAxis:s+F,alignmentAxis:a}),h&&hI({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?fI():void 0,...$}),h&&pI({...$}),mI({...$,apply:({elements:ke,rects:Be,availableWidth:Ce,availableHeight:Oe})=>{const{width:bt,height:hn}=Be.reference,xt=ke.floating.style;xt.setProperty("--radix-popper-available-width",`${Ce}px`),xt.setProperty("--radix-popper-available-height",`${Oe}px`),xt.setProperty("--radix-popper-anchor-width",`${bt}px`),xt.setProperty("--radix-popper-anchor-height",`${hn}px`)}}),M&&vI({element:M,padding:u}),EI({arrowWidth:j,arrowHeight:F}),_&&gI({strategy:"referenceHidden",...$})]}),[Z,N]=DT(B),z=oi(S);Pn(()=>{q&&(z==null||z())},[q,z]);const Y=(J=V.arrow)==null?void 0:J.x,A=(ge=V.arrow)==null?void 0:ge.y,oe=((ie=V.arrow)==null?void 0:ie.centerOffset)!==0,[fe,se]=b.useState();return Pn(()=>{k&&se(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ce=V.transformOrigin)==null?void 0:ce.x,(we=V.transformOrigin)==null?void 0:we.y].join(" "),...((Se=V.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(SI,{scope:n,placedSide:Z,onArrowChange:O,arrowX:Y,arrowY:A,shouldHideArrow:oe,children:g.jsx(et.div,{"data-side":Z,"data-align":N,...w,ref:R,style:{...w.style,animation:q?void 0:"none"}})})})});MT.displayName=Eb;var NT="PopperArrow",CI={top:"bottom",right:"left",bottom:"top",left:"right"},AT=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=wI(NT,r),a=CI[l.placedSide];return g.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:g.jsx(yI,{...s,ref:n,style:{...s.style,display:"block"}})})});AT.displayName=NT;function kI(e){return e!==null}var EI=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,a=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=a?0:e.arrowWidth,h=a?0:e.arrowHeight,[d,p]=DT(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,y=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let S="",w="";return d==="bottom"?(S=a?m:`${_}px`,w=`${-h}px`):d==="top"?(S=a?m:`${_}px`,w=`${r.floating.height+h}px`):d==="right"?(S=`${-h}px`,w=a?m:`${y}px`):d==="left"&&(S=`${r.floating.width+h}px`,w=a?m:`${y}px`),{data:{x:S,y:w}}}});function DT(e){const[t,n="center"]=e.split("-");return[t,n]}var hp=ET,Vu=TT,fp=MT,pp=AT,OT=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"}),RI="VisuallyHidden",LT=b.forwardRef((e,t)=>g.jsx(et.span,{...e,ref:t,style:{...OT,...e.style}}));LT.displayName=RI;var TI=LT,[mp]=ms("Tooltip",[po]),gp=po(),jT="TooltipProvider",MI=700,x_="tooltip.open",[NI,Rb]=mp(jT),zT=e=>{const{__scopeTooltip:t,delayDuration:n=MI,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,a=b.useRef(!0),u=b.useRef(!1),h=b.useRef(0);return b.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),g.jsx(NI,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(h.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:l})};zT.displayName=jT;var Ru="Tooltip",[AI,qu]=mp(Ru),PT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:a,delayDuration:u}=e,h=Rb(Ru,e.__scopeTooltip),d=gp(t),[p,m]=b.useState(null),_=cs(),y=b.useRef(0),S=a??h.disableHoverableContent,w=u??h.delayDuration,C=b.useRef(!1),[k,T]=wa({prop:r,defaultProp:s??!1,onChange:j=>{j?(h.onOpen(),document.dispatchEvent(new CustomEvent(x_))):h.onClose(),l==null||l(j)},caller:Ru}),R=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,T(!0)},[T]),O=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),D=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,T(!0),y.current=0},w)},[w,T]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),g.jsx(hp,{...d,children:g.jsx(AI,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{h.isOpenDelayedRef.current?D():M()},[h.isOpenDelayedRef,D,M]),onTriggerLeave:b.useCallback(()=>{S?O():(window.clearTimeout(y.current),y.current=0)},[O,S]),onOpen:M,onClose:O,disableHoverableContent:S,children:n})})};PT.displayName=Ru;var S_="TooltipTrigger",BT=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=qu(S_,n),l=Rb(S_,n),a=gp(n),u=b.useRef(null),h=ht(t,u,s.onTriggerChange),d=b.useRef(!1),p=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),g.jsx(Vu,{asChild:!0,...a,children:g.jsx(et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Re(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Re(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});BT.displayName=S_;var Tb="TooltipPortal",[DI,OI]=mp(Tb,{forceMount:void 0}),IT=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=qu(Tb,t);return g.jsx(DI,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(ja,{asChild:!0,container:s,children:r})})})};IT.displayName=Tb;var ka="TooltipContent",HT=b.forwardRef((e,t)=>{const n=OI(ka,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,a=qu(ka,e.__scopeTooltip);return g.jsx(Kr,{present:r||a.open,children:a.disableHoverableContent?g.jsx(FT,{side:s,...l,ref:t}):g.jsx(LI,{side:s,...l,ref:t})})}),LI=b.forwardRef((e,t)=>{const n=qu(ka,e.__scopeTooltip),r=Rb(ka,e.__scopeTooltip),s=b.useRef(null),l=ht(t,s),[a,u]=b.useState(null),{trigger:h,onClose:d}=n,p=s.current,{onPointerInTransitChange:m}=r,_=b.useCallback(()=>{u(null),m(!1)},[m]),y=b.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=II(k,C.getBoundingClientRect()),R=HI(k,T),M=FI(w.getBoundingClientRect()),O=$I([...R,...M]);u(O),m(!0)},[m]);return b.useEffect(()=>()=>_(),[_]),b.useEffect(()=>{if(h&&p){const S=C=>y(C,p),w=C=>y(C,h);return h.addEventListener("pointerleave",S),p.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",w)}}},[h,p,y,_]),b.useEffect(()=>{if(a){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(h==null?void 0:h.contains(C))||(p==null?void 0:p.contains(C)),R=!UI(k,a);T?_():R&&(_(),d())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,p,a,d,_]),g.jsx(FT,{...e,ref:l})}),[jI,zI]=mp(Ru,{isInside:!1}),PI=Ij("TooltipContent"),FT=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:a,...u}=e,h=qu(ka,n),d=gp(n),{onClose:p}=h;return b.useEffect(()=>(document.addEventListener(x_,p),()=>document.removeEventListener(x_,p)),[p]),b.useEffect(()=>{if(h.trigger){const m=_=>{const y=_.target;y!=null&&y.contains(h.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[h.trigger,p]),g.jsx(La,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:g.jsxs(fp,{"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:[g.jsx(PI,{children:r}),g.jsx(jI,{scope:n,isInside:!0,children:g.jsx(TI,{id:h.contentId,role:"tooltip",children:s||r})})]})})});HT.displayName=ka;var UT="TooltipArrow",BI=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=gp(n);return zI(UT,n).isInside?null:g.jsx(pp,{...s,...r,ref:t})});BI.displayName=UT;function II(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function HI(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 FI(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 UI(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,p=u.y,m=h.x,_=h.y;p>r!=_>r&&n<(m-d)*(r-p)/(_-p)+d&&(s=!s)}return s}function $I(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),WI(t)}function WI(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 l=t[t.length-1],a=t[t.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.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 l=n[n.length-1],a=n[n.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.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 VI=zT,$T=PT,WT=BT,VT=IT,Mb=HT;function qI({className:e,...t}){return g.jsx("kbd",{className:ye("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 KI({className:e,...t}){return g.jsx("span",{className:ye("inline-flex items-center gap-0.5",e),...t})}const GI="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",YI=VI,Mf=$T,Nf=WT,Tu=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(VT,{children:g.jsx(Mb,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border 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})}));Tu.displayName=Mb.displayName;const nu=$T,ru=WT;function qT(e){return e.toUpperCase()}function XI(e){const t=e.split("+");return g.jsx(KI,{children:t.map((n,r)=>g.jsx(qI,{children:qT(n)},`${n}-${r}`))})}const ha=b.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},l)=>{const a=r===void 0?null:Array.isArray(r)?r[0]??null:r;return g.jsx(VT,{children:g.jsx(Mb,{ref:l,sideOffset:t,className:ye(GI,e),...s,children:a?XI(a):g.jsx("span",{children:typeof n=="string"?qT(n):n})})})});ha.displayName="HotkeyTooltipContent";const ZI="0.16.0",QI={version:ZI},$n="Kanna",PC="kanna",JI=".kanna",e8=".kanna-dev",t8="KANNA_RUNTIME_PROFILE",Nb=`kanna/${QI.version}`,n8="[kanna]",r8=`~/${$n}`;function vp(){var t;return(t=globalThis.process)==null?void 0:t.env}function i8(e=vp()){var t;return((t=e==null?void 0:e[t8])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function s8(e=vp()){return i8(e)==="dev"?e8:JI}function o8(e=vp()){return`~/${s8(e)}`}function l8(e=vp()){return`${o8(e)}/keybindings.json`}function Ah(e){return e?`${PC} ${e}`:PC}const _p=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>g.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:ye("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 w_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const a8=[/^(?:\/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 c8(e){const t=e.trim();for(const n of a8){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function KT(e){return e.split("/").pop()||e}function u8(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,l=24*s,a=7*l;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<l?`${Math.floor(n/s)}h`:n<a?`${Math.floor(n/l)}d`:`${Math.floor(n/a)}w`}const d8=new Set(["starting","running"]);function h8({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const l=u8(e.lastMessageAt,n);return g.jsxs("div",{"data-chat-id":iC(e.chatId),className:ye("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 active:scale-[0.985] border transition-all",t===iC(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[d8.has(e.status)?g.jsx(Mi,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?g.jsx("div",{className:"relative ",children:g.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[g.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),g.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,g.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?g.jsx(_p,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),g.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[l?g.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:l}):null,g.jsx(rt,{variant:"ghost",size:"icon",className:ye("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",l?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:a=>{a.stopPropagation(),s(e.chatId)},title:"Delete chat",children:g.jsx(m6,{className:"size-3.5"})})]})]},e._id)}function f8(){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 yp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ia(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ab(e){return"nodeType"in e}function lr(e){var t,n;return e?Ia(e)?e:Ab(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Db(e){const{Document:t}=lr(e);return e instanceof t}function Ku(e){return Ia(e)?!1:e instanceof lr(e).HTMLElement}function GT(e){return e instanceof lr(e).SVGElement}function Ha(e){return e?Ia(e)?e.document:Ab(e)?Db(e)?e:Ku(e)||GT(e)?e.ownerDocument:document:document:document}const Ni=yp?b.useLayoutEffect:b.useEffect;function Ob(e){const t=b.useRef(e);return Ni(()=>{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 p8(){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 Mu(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return Ni(()=>{n.current!==e&&(n.current=e)},t),n}function Gu(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Af(e){const t=Ob(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 C_(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let bv={};function Yu(e,t){return b.useMemo(()=>{if(t)return t;const n=bv[e]==null?0:bv[e]+1;return bv[e]=n,e+"-"+n},[e,t])}function YT(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((l,a)=>{const u=Object.entries(a);for(const[h,d]of u){const p=l[h];p!=null&&(l[h]=p+e*d)}return l},{...t})}}const ya=YT(1),Df=YT(-1);function m8(e){return"clientX"in e&&"clientY"in e}function Lb(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function g8(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function k_(e){if(g8(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 m8(e)?{x:e.clientX,y:e.clientY}:null}const Nu=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[Nu.Translate.toString(e),Nu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),BC="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function v8(e){return e.matches(BC)?e:e.querySelector(BC)}const _8={display:"none"};function y8(e){let{id:t,value:n}=e;return Et.createElement("div",{id:t,style:_8},n)}function b8(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 Et.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function x8(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const XT=b.createContext(null);function S8(e){const t=b.useContext(XT);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function w8(){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:l}=r;e.forEach(a=>{var u;return(u=a[s])==null?void 0:u.call(a,l)})},[e]),t]}const C8={draggable:`
|
|
450
|
+
To pick up a draggable item, press the space bar.
|
|
451
|
+
While dragging, use the arrow keys to move the item.
|
|
452
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
453
|
+
`},k8={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 E8(e){let{announcements:t=k8,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=C8}=e;const{announce:l,announcement:a}=x8(),u=Yu("DndLiveRegion"),[h,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),S8(b.useMemo(()=>({onDragStart(m){let{active:_}=m;l(t.onDragStart({active:_}))},onDragMove(m){let{active:_,over:y}=m;t.onDragMove&&l(t.onDragMove({active:_,over:y}))},onDragOver(m){let{active:_,over:y}=m;l(t.onDragOver({active:_,over:y}))},onDragEnd(m){let{active:_,over:y}=m;l(t.onDragEnd({active:_,over:y}))},onDragCancel(m){let{active:_,over:y}=m;l(t.onDragCancel({active:_,over:y}))}}),[l,t])),!h)return null;const p=Et.createElement(Et.Fragment,null,Et.createElement(y8,{id:r,value:s.draggable}),Et.createElement(b8,{id:u,announcement:a}));return n?Si.createPortal(p,n):p}var un;(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"})(un||(un={}));function Of(){}function IC(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function R8(){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 ci=Object.freeze({x:0,y:0});function T8(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function M8(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function N8(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function A8(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function HC(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 D8=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=HC(t,t.left,t.top),l=[];for(const a of r){const{id:u}=a,h=n.get(u);if(h){const d=T8(HC(h),s);l.push({id:u,data:{droppableContainer:a,value:d}})}}return l.sort(M8)};function O8(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),l=Math.min(t.top+t.height,e.top+e.height),a=s-r,u=l-n;if(r<s&&n<l){const h=t.width*t.height,d=e.width*e.height,p=a*u,m=p/(h+d-p);return Number(m.toFixed(4))}return 0}const L8=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:a}=l,u=n.get(a);if(u){const h=O8(u,t);h>0&&s.push({id:a,data:{droppableContainer:l,value:h}})}}return s.sort(N8)};function j8(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ZT(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ci}function z8(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((a,u)=>({...a,top:a.top+e*u.y,bottom:a.bottom+e*u.y,left:a.left+e*u.x,right:a.right+e*u.x}),{...n})}}const P8=z8(1);function B8(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 I8(e,t,n){const r=B8(t);if(!r)return e;const{scaleX:s,scaleY:l,x:a,y:u}=r,h=e.left-a-(1-s)*parseFloat(n),d=e.top-u-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),p=s?e.width/s:e.width,m=l?e.height/l:e.height;return{width:p,height:m,top:d,right:h+p,bottom:d+m,left:h}}const H8={ignoreTransform:!1};function Fa(e,t){t===void 0&&(t=H8);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:p}=lr(e).getComputedStyle(e);d&&(n=I8(n,d,p))}const{top:r,left:s,width:l,height:a,bottom:u,right:h}=n;return{top:r,left:s,width:l,height:a,bottom:u,right:h}}function FC(e){return Fa(e,{ignoreTransform:!0})}function F8(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function U8(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function $8(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function jb(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Db(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Ku(s)||GT(s)||n.includes(s))return n;const l=lr(e).getComputedStyle(s);return s!==e&&$8(s,l)&&n.push(s),U8(s,l)?n:r(s.parentNode)}return e?r(e):n}function QT(e){const[t]=jb(e,1);return t??null}function xv(e){return!yp||!e?null:Ia(e)?e:Ab(e)?Db(e)||e===Ha(e).scrollingElement?window:Ku(e)?e:null:null}function JT(e){return Ia(e)?e.scrollX:e.scrollLeft}function eM(e){return Ia(e)?e.scrollY:e.scrollTop}function E_(e){return{x:JT(e),y:eM(e)}}var gn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(gn||(gn={}));function tM(e){return!yp||!e?!1:e===document.scrollingElement}function nM(e){const t={x:0,y:0},n=tM(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,l=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:a,isRight:u,maxScroll:r,minScroll:t}}const W8={x:.2,y:.2};function V8(e,t,n,r,s){let{top:l,left:a,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=W8);const{isTop:d,isBottom:p,isLeft:m,isRight:_}=nM(e),y={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!d&&l<=t.top+w.height?(y.y=gn.Backward,S.y=r*Math.abs((t.top+w.height-l)/w.height)):!p&&h>=t.bottom-w.height&&(y.y=gn.Forward,S.y=r*Math.abs((t.bottom-w.height-h)/w.height)),!_&&u>=t.right-w.width?(y.x=gn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!m&&a<=t.left+w.width&&(y.x=gn.Backward,S.x=r*Math.abs((t.left+w.width-a)/w.width)),{direction:y,speed:S}}function q8(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:a}=window;return{top:0,left:0,right:l,bottom:a,width:l,height:a}}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 rM(e){return e.reduce((t,n)=>ya(t,E_(n)),ci)}function K8(e){return e.reduce((t,n)=>t+JT(n),0)}function G8(e){return e.reduce((t,n)=>t+eM(n),0)}function Y8(e,t){if(t===void 0&&(t=Fa),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);QT(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const X8=[["x",["left","right"],K8],["y",["top","bottom"],G8]];class zb{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=jb(n),s=rM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,a,u]of X8)for(const h of a)Object.defineProperty(this,h,{get:()=>{const d=u(r),p=s[l]-d;return this.rect[h]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mu{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 Z8(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Ha(e)}function Sv(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 Fr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Fr||(Fr={}));function UC(e){e.preventDefault()}function Q8(e){e.stopPropagation()}var dt;(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"})(dt||(dt={}));const iM={start:[dt.Space,dt.Enter],cancel:[dt.Esc],end:[dt.Space,dt.Enter,dt.Tab]},J8=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case dt.Right:return{...n,x:n.x+25};case dt.Left:return{...n,x:n.x-25};case dt.Down:return{...n,y:n.y+25};case dt.Up:return{...n,y:n.y-25}}};class Pb{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 mu(Ha(n)),this.windowListeners=new mu(lr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Y8(r),n(ci)}handleKeyDown(t){if(Lb(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=iM,coordinateGetter:a=J8,scrollBehavior:u="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,p=d?{x:d.left,y:d.top}:ci;this.referenceCoordinates||(this.referenceCoordinates=p);const m=a(t,{active:n,context:r.current,currentCoordinates:p});if(m){const _=Df(m,p),y={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:M,maxScroll:O,minScroll:D}=nM(w),j=q8(w),F={x:Math.min(C===dt.Right?j.right-j.width/2:j.right,Math.max(C===dt.Right?j.left:j.left+j.width/2,m.x)),y:Math.min(C===dt.Down?j.bottom-j.height/2:j.bottom,Math.max(C===dt.Down?j.top:j.top+j.height/2,m.y))},G=C===dt.Right&&!T||C===dt.Left&&!R,P=C===dt.Down&&!M||C===dt.Up&&!k;if(G&&F.x!==m.x){const W=w.scrollLeft+_.x,I=C===dt.Right&&W<=O.x||C===dt.Left&&W>=D.x;if(I&&!_.y){w.scrollTo({left:W,behavior:u});return}I?y.x=w.scrollLeft-W:y.x=C===dt.Right?w.scrollLeft-O.x:w.scrollLeft-D.x,y.x&&w.scrollBy({left:-y.x,behavior:u});break}else if(P&&F.y!==m.y){const W=w.scrollTop+_.y,I=C===dt.Down&&W<=O.y||C===dt.Up&&W>=D.y;if(I&&!_.x){w.scrollTo({top:W,behavior:u});return}I?y.y=w.scrollTop-W:y.y=C===dt.Down?w.scrollTop-O.y:w.scrollTop-D.y,y.y&&w.scrollBy({top:-y.y,behavior:u});break}}this.handleMove(t,ya(Df(m,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()}}Pb.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=iM,onActivation:s}=t,{active:l}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function $C(e){return!!(e&&"distance"in e)}function WC(e){return!!(e&&"delay"in e)}class Bb{constructor(t,n,r){var s;r===void 0&&(r=Z8(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:l}=t,{target:a}=l;this.props=t,this.events=n,this.document=Ha(a),this.documentListeners=new mu(this.document),this.listeners=new mu(r),this.windowListeners=new mu(lr(a)),this.initialCoordinates=(s=k_(l))!=null?s:ci,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(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.DragStart,UC),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),this.windowListeners.add(Fr.ContextMenu,UC),this.documentListeners.add(Fr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WC(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if($C(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(Fr.Click,Q8,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:a,options:{activationConstraint:u}}=l;if(!s)return;const h=(n=k_(t))!=null?n:ci,d=Df(s,h);if(!r&&u){if($C(u)){if(u.tolerance!=null&&Sv(d,u.tolerance))return this.handleCancel();if(Sv(d,u.distance))return this.handleStart()}if(WC(u)&&Sv(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),a(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===dt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const e7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ib extends Bb{constructor(t){const{event:n}=t,r=Ha(n.target);super(t,e7,r)}}Ib.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 t7={move:{name:"mousemove"},end:{name:"mouseup"}};var R_;(function(e){e[e.RightClick=2]="RightClick"})(R_||(R_={}));class n7 extends Bb{constructor(t){super(t,t7,Ha(t.event.target))}}n7.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===R_.RightClick?!1:(r==null||r({event:n}),!0)}}];const wv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class r7 extends Bb{constructor(t){super(t,wv)}static setup(){return window.addEventListener(wv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wv.move.name,t)};function t(){}}}r7.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 gu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(gu||(gu={}));var Lf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Lf||(Lf={}));function i7(e){let{acceleration:t,activator:n=gu.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:a=5,order:u=Lf.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:p,delta:m,threshold:_}=e;const y=o7({delta:m,disabled:!l}),[S,w]=p8(),C=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),T=b.useMemo(()=>{switch(n){case gu.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case gu.DraggableRect:return s}},[n,s,h]),R=b.useRef(null),M=b.useCallback(()=>{const D=R.current;if(!D)return;const j=C.current.x*k.current.x,F=C.current.y*k.current.y;D.scrollBy(j,F)},[]),O=b.useMemo(()=>u===Lf.TreeOrder?[...d].reverse():d,[u,d]);b.useEffect(()=>{if(!l||!d.length||!T){w();return}for(const D of O){if((r==null?void 0:r(D))===!1)continue;const j=d.indexOf(D),F=p[j];if(!F)continue;const{direction:G,speed:P}=V8(D,F,T,t,_);for(const W of["x","y"])y[W][G[W]]||(P[W]=0,G[W]=0);if(P.x>0||P.y>0){w(),R.current=D,S(M,a),C.current=P,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,M,r,w,l,a,JSON.stringify(T),JSON.stringify(y),S,d,O,p,JSON.stringify(_)])}const s7={x:{[gn.Backward]:!1,[gn.Forward]:!1},y:{[gn.Backward]:!1,[gn.Forward]:!1}};function o7(e){let{delta:t,disabled:n}=e;const r=C_(t);return Gu(s=>{if(n||!r||!s)return s7;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[gn.Backward]:s.x[gn.Backward]||l.x===-1,[gn.Forward]:s.x[gn.Forward]||l.x===1},y:{[gn.Backward]:s.y[gn.Backward]||l.y===-1,[gn.Forward]:s.y[gn.Forward]||l.y===1}}},[n,t,r])}function l7(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Gu(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function a7(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...l]},[]),[e,t])}var Au;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Au||(Au={}));var T_;(function(e){e.Optimized="optimized"})(T_||(T_={}));const VC=new Map;function c7(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,a]=b.useState(null),{frequency:u,measure:h,strategy:d}=s,p=b.useRef(e),m=C(),_=Mu(m),y=b.useCallback(function(k){k===void 0&&(k=[]),!_.current&&a(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=b.useRef(null),w=Gu(k=>{if(m&&!n)return VC;if(!k||k===VC||p.current!==e||l!=null){const T=new Map;for(let R of e){if(!R)continue;if(l&&l.length>0&&!l.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const M=R.node.current,O=M?new zb(h(M),M):null;R.rect.current=O,O&&T.set(R.id,O)}return T}return k},[e,l,n,m,h]);return b.useEffect(()=>{p.current=e},[e]),b.useEffect(()=>{m||y()},[n,m]),b.useEffect(()=>{l&&l.length>0&&a(null)},[JSON.stringify(l)]),b.useEffect(()=>{m||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{y(),S.current=null},u))},[u,m,y,...r]),{droppableRects:w,measureDroppableContainers:y,measuringScheduled:l!=null};function C(){switch(d){case Au.Always:return!1;case Au.BeforeDragging:return n;default:return!n}}}function sM(e,t){return Gu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function u7(e,t){return sM(e,t)}function d7(e){let{callback:t,disabled:n}=e;const r=Ob(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function bp(e){let{callback:t,disabled:n}=e;const r=Ob(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function h7(e){return new zb(Fa(e),e)}function qC(e,t,n){t===void 0&&(t=h7);const[r,s]=b.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const p=t(e);return JSON.stringify(h)===JSON.stringify(p)?h:p})}const a=d7({callback(h){if(e)for(const d of h){const{type:p,target:m}=d;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){l();break}}}}),u=bp({callback:l});return Ni(()=>{l(),e?(u==null||u.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),a==null||a.disconnect())},[e]),r}function f7(e){const t=sM(e);return ZT(e,t)}const KC=[];function p7(e){const t=b.useRef(e),n=Gu(r=>e?r&&r!==KC&&e&&t.current&&e.parentNode===t.current.parentNode?r:jb(e):KC,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function m7(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(l=>{const a=xv(l.target);a&&n(u=>u?(u.set(a,E_(a)),new Map(u)):null)},[]);return b.useEffect(()=>{const l=r.current;if(e!==l){a(l);const u=e.map(h=>{const d=xv(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,E_(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{a(e),a(l)};function a(u){u.forEach(h=>{const d=xv(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,a)=>ya(l,a),ci):rM(e):ci,[e,t])}function GC(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==ci;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Df(e,n.current):ci}function g7(e){b.useEffect(()=>{if(!yp)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 v7(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=a=>{l(a,t)},n},{}),[e,t])}function oM(e){return b.useMemo(()=>e?F8(e):null,[e])}const YC=[];function _7(e,t){t===void 0&&(t=Fa);const[n]=e,r=oM(n?lr(n):null),[s,l]=b.useState(YC);function a(){l(()=>e.length?e.map(h=>tM(h)?r:new zb(t(h),h)):YC)}const u=bp({callback:a});return Ni(()=>{u==null||u.disconnect(),a(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function y7(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ku(t)?t:e}function b7(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:p}of d)if(Ku(p)){r(m=>{const _=t(p);return m?{...m,width:_.width,height:_.height}:_});break}},[t]),l=bp({callback:s}),a=b.useCallback(d=>{const p=y7(d);l==null||l.disconnect(),p&&(l==null||l.observe(p)),r(p?t(p):null)},[t,l]),[u,h]=Af(a);return b.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const x7=[{sensor:Ib,options:{}},{sensor:Pb,options:{}}],S7={current:{}},rf={draggable:{measure:FC},droppable:{measure:FC,strategy:Au.WhileDragging,frequency:T_.Optimized},dragOverlay:{measure:Fa}};class vu 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 w7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Of},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rf,measureDroppableContainers:Of,windowRect:null,measuringScheduled:!1},C7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Of,draggableNodes:new Map,over:null,measureDroppableContainers:Of},xp=b.createContext(C7),lM=b.createContext(w7);function k7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vu}}}function E7(e,t){switch(t.type){case un.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case un.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 un.DragEnd:case un.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case un.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new vu(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case un.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const a=new vu(e.droppable.containers);return a.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case un.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new vu(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function R7(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(xp),l=C_(r),a=C_(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&l&&a!=null){if(!Lb(l)||document.activeElement===l.target)return;const u=s.get(a);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const p of[h.current,d.current]){if(!p)continue;const m=v8(p);if(m){m.focus();break}}})}},[r,t,s,a,l]),null}function T7(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function M7(e){return b.useMemo(()=>({draggable:{...rf.draggable,...e==null?void 0:e.draggable},droppable:{...rf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...rf.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 N7(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=b.useRef(!1),{x:a,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Ni(()=>{if(!a&&!u||!t){l.current=!1;return}if(l.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const p=n(d),m=ZT(p,r);if(a||(m.x=0),u||(m.y=0),l.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const _=QT(d);_&&_.scrollBy({top:m.y,left:m.x})}},[t,a,u,r,n])}const aM=b.createContext({...ci,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const A7=b.memo(function(t){var n,r,s,l;let{id:a,accessibility:u,autoScroll:h=!0,children:d,sensors:p=x7,collisionDetection:m=L8,measuring:_,modifiers:y,...S}=t;const w=b.useReducer(E7,void 0,k7),[C,k]=w,[T,R]=w8(),[M,O]=b.useState(eo.Uninitialized),D=M===eo.Initialized,{draggable:{active:j,nodes:F,translate:G},droppable:{containers:P}}=C,W=j!=null?F.get(j):null,I=b.useRef({initial:null,translated:null}),$=b.useMemo(()=>{var At;return j!=null?{id:j,data:(At=W==null?void 0:W.data)!=null?At:S7,rect:I}:null},[j,W]),U=b.useRef(null),[H,B]=b.useState(null),[q,V]=b.useState(null),Z=Mu(S,Object.values(S)),N=Yu("DndDescribedBy",a),z=b.useMemo(()=>P.getEnabled(),[P]),Y=M7(_),{droppableRects:A,measureDroppableContainers:oe,measuringScheduled:fe}=c7(z,{dragging:D,dependencies:[G.x,G.y],config:Y.droppable}),se=l7(F,j),J=b.useMemo(()=>q?k_(q):null,[q]),ge=Li(),ie=u7(se,Y.draggable.measure);N7({activeNode:j!=null?F.get(j):null,config:ge.layoutShiftCompensation,initialRect:ie,measure:Y.draggable.measure});const ce=qC(se,Y.draggable.measure,ie),we=qC(se?se.parentElement:null),Se=b.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:A,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=P.getNodeFor((n=Se.current.over)==null?void 0:n.id),Be=b7({measure:Y.dragOverlay.measure}),Ce=(r=Be.nodeRef.current)!=null?r:se,Oe=D?(s=Be.rect)!=null?s:ce:null,bt=!!(Be.nodeRef.current&&Be.rect),hn=f7(bt?null:ce),xt=oM(Ce?lr(Ce):null),zt=p7(D?ke??se:null),In=_7(zt),cr=T7(y,{transform:{x:G.x-hn.x,y:G.y-hn.y,scaleX:1,scaleY:1},activatorEvent:q,active:$,activeNodeRect:ce,containerNodeRect:we,draggingNodeRect:Oe,over:Se.current.over,overlayNodeRect:Be.rect,scrollableAncestors:zt,scrollableAncestorRects:In,windowRect:xt}),Gr=J?ya(J,G):null,le=m7(zt),Rt=GC(le),ue=GC(le,[ce]),ve=ya(cr,Rt),Le=Oe?P8(Oe,cr):null,Ie=$&&Le?m({active:$,collisionRect:Le,droppableRects:A,droppableContainers:z,pointerCoordinates:Gr}):null,Xe=A8(Ie,"id"),[Ct,Yn]=b.useState(null),nn=bt?cr:ya(cr,ue),Pt=j8(nn,(l=Ct==null?void 0:Ct.rect)!=null?l:null,ce),Gt=b.useRef(null),ot=b.useCallback((At,Dt)=>{let{sensor:re,options:_e}=Dt;if(U.current==null)return;const Ue=F.get(U.current);if(!Ue)return;const Ye=At.nativeEvent,lt=new re({active:U.current,activeNode:Ue,event:Ye,options:_e,context:Se,onAbort(rn){if(!F.get(rn))return;const{onDragAbort:dr}=Z.current,Er={id:rn};dr==null||dr(Er),T({type:"onDragAbort",event:Er})},onPending(rn,Yr,dr,Er){if(!F.get(rn))return;const{onDragPending:zi}=Z.current,Xr={id:rn,constraint:Yr,initialCoordinates:dr,offset:Er};zi==null||zi(Xr),T({type:"onDragPending",event:Xr})},onStart(rn){const Yr=U.current;if(Yr==null)return;const dr=F.get(Yr);if(!dr)return;const{onDragStart:Er}=Z.current,ji={activatorEvent:Ye,active:{id:Yr,data:dr.data,rect:I}};Si.unstable_batchedUpdates(()=>{Er==null||Er(ji),O(eo.Initializing),k({type:un.DragStart,initialCoordinates:rn,active:Yr}),T({type:"onDragStart",event:ji}),B(Gt.current),V(Ye)})},onMove(rn){k({type:un.DragMove,coordinates:rn})},onEnd:ur(un.DragEnd),onCancel:ur(un.DragCancel)});Gt.current=lt;function ur(rn){return async function(){const{active:dr,collisions:Er,over:ji,scrollAdjustedTranslate:zi}=Se.current;let Xr=null;if(dr&&zi){const{cancelDrop:xs}=Z.current;Xr={activatorEvent:Ye,active:dr,collisions:Er,delta:zi,over:ji},rn===un.DragEnd&&typeof xs=="function"&&await Promise.resolve(xs(Xr))&&(rn=un.DragCancel)}U.current=null,Si.unstable_batchedUpdates(()=>{k({type:rn}),O(eo.Uninitialized),Yn(null),B(null),V(null),Gt.current=null;const xs=rn===un.DragEnd?"onDragEnd":"onDragCancel";if(Xr){const Rr=Z.current[xs];Rr==null||Rr(Xr),T({type:xs,event:Xr})}})}}},[F]),Xn=b.useCallback((At,Dt)=>(re,_e)=>{const Ue=re.nativeEvent,Ye=F.get(_e);if(U.current!==null||!Ye||Ue.dndKit||Ue.defaultPrevented)return;const lt={active:Ye};At(re,Dt.options,lt)===!0&&(Ue.dndKit={capturedBy:Dt.sensor},U.current=_e,ot(re,Dt))},[F,ot]),Dn=a7(p,Xn);g7(p),Ni(()=>{ce&&M===eo.Initializing&&O(eo.Initialized)},[ce,M]),b.useEffect(()=>{const{onDragMove:At}=Z.current,{active:Dt,activatorEvent:re,collisions:_e,over:Ue}=Se.current;if(!Dt||!re)return;const Ye={active:Dt,activatorEvent:re,collisions:_e,delta:{x:ve.x,y:ve.y},over:Ue};Si.unstable_batchedUpdates(()=>{At==null||At(Ye),T({type:"onDragMove",event:Ye})})},[ve.x,ve.y]),b.useEffect(()=>{const{active:At,activatorEvent:Dt,collisions:re,droppableContainers:_e,scrollAdjustedTranslate:Ue}=Se.current;if(!At||U.current==null||!Dt||!Ue)return;const{onDragOver:Ye}=Z.current,lt=_e.get(Xe),ur=lt&<.rect.current?{id:lt.id,rect:lt.rect.current,data:lt.data,disabled:lt.disabled}:null,rn={active:At,activatorEvent:Dt,collisions:re,delta:{x:Ue.x,y:Ue.y},over:ur};Si.unstable_batchedUpdates(()=>{Yn(ur),Ye==null||Ye(rn),T({type:"onDragOver",event:rn})})},[Xe]),Ni(()=>{Se.current={activatorEvent:q,active:$,activeNode:se,collisionRect:Le,collisions:Ie,droppableRects:A,draggableNodes:F,draggingNode:Ce,draggingNodeRect:Oe,droppableContainers:P,over:Ct,scrollableAncestors:zt,scrollAdjustedTranslate:ve},I.current={initial:Oe,translated:Le}},[$,se,Ie,Le,F,Ce,Oe,A,P,Ct,zt,ve]),i7({...ge,delta:G,draggingRect:Le,pointerCoordinates:Gr,scrollableAncestors:zt,scrollableAncestorRects:In});const Ya=b.useMemo(()=>({active:$,activeNode:se,activeNodeRect:ce,activatorEvent:q,collisions:Ie,containerNodeRect:we,dragOverlay:Be,draggableNodes:F,droppableContainers:P,droppableRects:A,over:Ct,measureDroppableContainers:oe,scrollableAncestors:zt,scrollableAncestorRects:In,measuringConfiguration:Y,measuringScheduled:fe,windowRect:xt}),[$,se,ce,q,Ie,we,Be,F,P,A,Ct,oe,zt,In,Y,fe,xt]),bs=b.useMemo(()=>({activatorEvent:q,activators:Dn,active:$,activeNodeRect:ce,ariaDescribedById:{draggable:N},dispatch:k,draggableNodes:F,over:Ct,measureDroppableContainers:oe}),[q,Dn,$,ce,k,N,F,Ct,oe]);return Et.createElement(XT.Provider,{value:R},Et.createElement(xp.Provider,{value:bs},Et.createElement(lM.Provider,{value:Ya},Et.createElement(aM.Provider,{value:Pt},d)),Et.createElement(R7,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Et.createElement(E8,{...u,hiddenTextDescribedById:N}));function Li(){const At=(H==null?void 0:H.autoScrollEnabled)===!1,Dt=typeof h=="object"?h.enabled===!1:h===!1,re=D&&!At&&!Dt;return typeof h=="object"?{...h,enabled:re}:{enabled:re}}}),D7=b.createContext(null),XC="button",O7="Draggable";function L7(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=Yu(O7),{activators:a,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:p,draggableNodes:m,over:_}=b.useContext(xp),{role:y=XC,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(h==null?void 0:h.id)===t,k=b.useContext(C?aM:D7),[T,R]=Af(),[M,O]=Af(),D=v7(a,t),j=Mu(n);Ni(()=>(m.set(t,{id:t,key:l,node:T,activatorNode:M,data:j}),()=>{const G=m.get(t);G&&G.key===l&&m.delete(t)}),[m,t]);const F=b.useMemo(()=>({role:y,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&y===XC?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[r,y,w,C,S,p.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:F,isDragging:C,listeners:r?void 0:D,node:T,over:_,setNodeRef:R,setActivatorNodeRef:O,transform:k}}function j7(){return b.useContext(lM)}const z7="Droppable",P7={timeout:25};function B7(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=Yu(z7),{active:a,dispatch:u,over:h,measureDroppableContainers:d}=b.useContext(xp),p=b.useRef({disabled:n}),m=b.useRef(!1),_=b.useRef(null),y=b.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...P7,...s},k=Mu(w??r),T=b.useCallback(()=>{if(!m.current){m.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]),R=bp({callback:T,disabled:S||!a}),M=b.useCallback((F,G)=>{R&&(G&&(R.unobserve(G),m.current=!1),F&&R.observe(F))},[R]),[O,D]=Af(M),j=Mu(t);return b.useEffect(()=>{!R||!O.current||(R.disconnect(),m.current=!1,R.observe(O.current))},[O,R]),b.useEffect(()=>(u({type:un.RegisterDroppable,element:{id:r,key:l,disabled:n,node:O,rect:_,data:j}}),()=>u({type:un.UnregisterDroppable,key:l,id:r})),[r]),b.useEffect(()=>{n!==p.current.disabled&&(u({type:un.SetDroppableDisabled,id:r,key:l,disabled:n}),p.current.disabled=n)},[r,l,n,u]),{active:a,rect:_,isOver:(h==null?void 0:h.id)===r,node:O,over:h,setNodeRef:D}}function Hb(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function I7(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Dh(e){return e!==null&&e>=0}function H7(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 F7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const cM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=Hb(t,r,n),a=t[s],u=l[s];return!u||!a?null:{x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height}},Oh={scaleX:1,scaleY:1},U7=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:a}=e;const u=(t=l[n])!=null?t:r;if(!u)return null;if(s===n){const d=l[a];return d?{x:0,y:n<a?d.top+d.height-(u.top+u.height):d.top-u.top,...Oh}:null}const h=$7(l,s,n);return s>n&&s<=a?{x:0,y:-u.height-h,...Oh}:s<n&&s>=a?{x:0,y:u.height+h,...Oh}:{x:0,y:0,...Oh}};function $7(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const uM="Sortable",dM=Et.createContext({activeIndex:-1,containerId:uM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cM,disabled:{draggable:!1,droppable:!1}});function W7(e){let{children:t,id:n,items:r,strategy:s=cM,disabled:l=!1}=e;const{active:a,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:p}=j7(),m=Yu(uM,n),_=u.rect!==null,y=b.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),S=a!=null,w=a?y.indexOf(a.id):-1,C=d?y.indexOf(d.id):-1,k=b.useRef(y),T=!H7(y,k.current),R=C!==-1&&w===-1||T,M=F7(l);Ni(()=>{T&&S&&p(y)},[T,y,S,p]),b.useEffect(()=>{k.current=y},[y]);const O=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:M,disableTransforms:R,items:y,overIndex:C,useDragOverlay:_,sortedRects:I7(y,h),strategy:s}),[w,m,M.draggable,M.droppable,R,y,C,h,_,s]);return Et.createElement(dM.Provider,{value:O},t)}const V7=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Hb(n,r,s).indexOf(t)},q7=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:a,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==l&&s===a?!1:n?!0:a!==s&&t===h},K7={duration:200,easing:"ease"},hM="transform",G7=Nu.Transition.toString({property:hM,duration:0,easing:"linear"}),Y7={roleDescription:"sortable"};function X7(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,a]=b.useState(null),u=b.useRef(n);return Ni(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Fa(r.current,{ignoreTransform:!0}),p={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(p.x||p.y)&&a(p)}}n!==u.current&&(u.current=n)},[t,n,r,s]),b.useEffect(()=>{l&&a(null)},[l]),l}function Z7(e){let{animateLayoutChanges:t=q7,attributes:n,disabled:r,data:s,getNewIndex:l=V7,id:a,strategy:u,resizeObserverConfig:h,transition:d=K7}=e;const{items:p,containerId:m,activeIndex:_,disabled:y,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=b.useContext(dM),R=Q7(r,y),M=p.indexOf(a),O=b.useMemo(()=>({sortable:{containerId:m,index:M,items:p},...s}),[m,s,M,p]),D=b.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:j,node:F,isOver:G,setNodeRef:P}=B7({id:a,data:O,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:W,activatorEvent:I,activeNodeRect:$,attributes:U,setNodeRef:H,listeners:B,isDragging:q,over:V,setActivatorNodeRef:Z,transform:N}=L7({id:a,data:O,attributes:{...Y7,...n},disabled:R.draggable}),z=f8(P,H),Y=!!W,A=Y&&!S&&Dh(_)&&Dh(C),oe=!k&&q,fe=oe&&A?N:null,J=A?fe??(u??T)({rects:w,activeNodeRect:$,activeIndex:_,overIndex:C,index:M}):null,ge=Dh(_)&&Dh(C)?l({id:a,items:p,activeIndex:_,overIndex:C}):M,ie=W==null?void 0:W.id,ce=b.useRef({activeId:ie,items:p,newIndex:ge,containerId:m}),we=p!==ce.current.items,Se=t({active:W,containerId:m,isDragging:q,isSorting:Y,id:a,index:M,items:p,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:d,wasDragging:ce.current.activeId!=null}),ke=X7({disabled:!Se,index:M,node:F,rect:j});return b.useEffect(()=>{Y&&ce.current.newIndex!==ge&&(ce.current.newIndex=ge),m!==ce.current.containerId&&(ce.current.containerId=m),p!==ce.current.items&&(ce.current.items=p)},[Y,ge,m,p]),b.useEffect(()=>{if(ie===ce.current.activeId)return;if(ie!=null&&ce.current.activeId==null){ce.current.activeId=ie;return}const Ce=setTimeout(()=>{ce.current.activeId=ie},50);return()=>clearTimeout(Ce)},[ie]),{active:W,activeIndex:_,attributes:U,data:O,rect:j,index:M,newIndex:ge,items:p,isOver:G,isSorting:Y,isDragging:q,listeners:B,node:F,overIndex:C,over:V,setNodeRef:z,setActivatorNodeRef:Z,setDroppableNodeRef:P,setDraggableNodeRef:H,transform:ke??J,transition:Be()};function Be(){if(ke||we&&ce.current.newIndex===M)return G7;if(!(oe&&!Lb(I)||!d)&&(Y||Se))return Nu.Transition.toString({...d,property:hM})}}function Q7(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}}dt.Down,dt.Right,dt.Up,dt.Left;function Fb(e){const t=e+"CollectionProvider",[n,r]=ms(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:C,children:k}=w,T=Et.useRef(null),R=Et.useRef(new Map).current;return g.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};a.displayName=t;const u=e+"CollectionSlot",h=Qo(u),d=Et.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=l(u,k),M=ht(C,R.collectionRef);return g.jsx(h,{ref:M,children:T})});d.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",_=Qo(p),y=Et.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,M=Et.useRef(null),O=ht(C,M),D=l(p,k);return Et.useEffect(()=>(D.itemMap.set(M,{ref:M,...R}),()=>void D.itemMap.delete(M))),g.jsx(_,{[m]:"",ref:O,children:T})});y.displayName=p;function S(w){const C=l(e+"CollectionConsumer",w);return Et.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((D,j)=>R.indexOf(D.ref.current)-R.indexOf(j.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:d,ItemSlot:y},S,r]}var J7=b.createContext(void 0);function Ub(e){const t=b.useContext(J7);return e||t||"ltr"}var Cv="rovingFocusGroup.onEntryFocus",e9={bubbles:!1,cancelable:!0},Xu="RovingFocusGroup",[M_,fM,t9]=Fb(Xu),[n9,pM]=ms(Xu,[t9]),[r9,i9]=n9(Xu),mM=b.forwardRef((e,t)=>g.jsx(M_.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(M_.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(s9,{...e,ref:t})})}));mM.displayName=Xu;var s9=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,_=b.useRef(null),y=ht(t,_),S=Ub(l),[w,C]=wa({prop:a,defaultProp:u??null,onChange:h,caller:Xu}),[k,T]=b.useState(!1),R=oi(d),M=fM(n),O=b.useRef(!1),[D,j]=b.useState(0);return b.useEffect(()=>{const F=_.current;if(F)return F.addEventListener(Cv,R),()=>F.removeEventListener(Cv,R)},[R]),g.jsx(r9,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(F=>C(F),[C]),onItemShiftTab:b.useCallback(()=>T(!0),[]),onFocusableItemAdd:b.useCallback(()=>j(F=>F+1),[]),onFocusableItemRemove:b.useCallback(()=>j(F=>F-1),[]),children:g.jsx(et.div,{tabIndex:k||D===0?-1:0,"data-orientation":r,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{O.current=!0}),onFocus:Re(e.onFocus,F=>{const G=!O.current;if(F.target===F.currentTarget&&G&&!k){const P=new CustomEvent(Cv,e9);if(F.currentTarget.dispatchEvent(P),!P.defaultPrevented){const W=M().filter(B=>B.focusable),I=W.find(B=>B.active),$=W.find(B=>B.id===w),H=[I,$,...W].filter(Boolean).map(B=>B.ref.current);_M(H,p)}}O.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),gM="RovingFocusGroupItem",vM=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:a,...u}=e,h=cs(),d=l||h,p=i9(gM,n),m=p.currentTabStopId===d,_=fM(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:w}=p;return b.useEffect(()=>{if(r)return y(),()=>S()},[r,y,S]),g.jsx(M_.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:g.jsx(et.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Re(e.onMouseDown,C=>{r?p.onItemFocus(d):C.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=a9(C,p.orientation,p.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(M=>M.focusable).map(M=>M.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const M=R.indexOf(C.currentTarget);R=p.loop?c9(R,M+1):R.slice(M+1)}setTimeout(()=>_M(R))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});vM.displayName=gM;var o9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function a9(e,t,n){const r=l9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return o9[r]}function _M(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function c9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var u9=mM,d9=vM,N_=["Enter"," "],h9=["ArrowDown","PageUp","Home"],yM=["ArrowUp","PageDown","End"],f9=[...h9,...yM],p9={ltr:[...N_,"ArrowRight"],rtl:[...N_,"ArrowLeft"]},m9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zu="Menu",[Du,g9,v9]=Fb(Zu),[ul,bM]=ms(Zu,[v9,po,pM]),Sp=po(),xM=pM(),[_9,dl]=ul(Zu),[y9,Qu]=ul(Zu),SM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:a=!0}=e,u=Sp(t),[h,d]=b.useState(null),p=b.useRef(!1),m=oi(l),_=Ub(s);return b.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),g.jsx(hp,{...u,children:g.jsx(_9,{scope:t,open:n,onOpenChange:m,content:h,onContentChange:d,children:g.jsx(y9,{scope:t,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:_,modal:a,children:r})})})};SM.displayName=Zu;var b9="MenuAnchor",$b=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sp(n);return g.jsx(Vu,{...s,...r,ref:t})});$b.displayName=b9;var Wb="MenuPortal",[x9,wM]=ul(Wb,{forceMount:void 0}),CM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=dl(Wb,t);return g.jsx(x9,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(ja,{asChild:!0,container:s,children:r})})})};CM.displayName=Wb;var Wr="MenuContent",[S9,Vb]=ul(Wr),kM=b.forwardRef((e,t)=>{const n=wM(Wr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=dl(Wr,e.__scopeMenu),a=Qu(Wr,e.__scopeMenu);return g.jsx(Du.Provider,{scope:e.__scopeMenu,children:g.jsx(Kr,{present:r||l.open,children:g.jsx(Du.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(w9,{...s,ref:t}):g.jsx(C9,{...s,ref:t})})})})}),w9=b.forwardRef((e,t)=>{const n=dl(Wr,e.__scopeMenu),r=b.useRef(null),s=ht(t,r);return b.useEffect(()=>{const l=r.current;if(l)return sp(l)},[]),g.jsx(qb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),C9=b.forwardRef((e,t)=>{const n=dl(Wr,e.__scopeMenu);return g.jsx(qb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),k9=Qo("MenuContent.ScrollLock"),qb=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,disableOutsideScroll:S,...w}=e,C=dl(Wr,n),k=Qu(Wr,n),T=Sp(n),R=xM(n),M=g9(n),[O,D]=b.useState(null),j=b.useRef(null),F=ht(t,j,C.onContentChange),G=b.useRef(0),P=b.useRef(""),W=b.useRef(0),I=b.useRef(null),$=b.useRef("right"),U=b.useRef(0),H=S?$u:b.Fragment,B=S?{as:k9,allowPinchZoom:!0}:void 0,q=Z=>{var J,ge;const N=P.current+Z,z=M().filter(ie=>!ie.disabled),Y=document.activeElement,A=(J=z.find(ie=>ie.ref.current===Y))==null?void 0:J.textValue,oe=z.map(ie=>ie.textValue),fe=P9(oe,N,A),se=(ge=z.find(ie=>ie.textValue===fe))==null?void 0:ge.ref.current;(function ie(ce){P.current=ce,window.clearTimeout(G.current),ce!==""&&(G.current=window.setTimeout(()=>ie(""),1e3))})(N),se&&setTimeout(()=>se.focus())};b.useEffect(()=>()=>window.clearTimeout(G.current),[]),rp();const V=b.useCallback(Z=>{var z,Y;return $.current===((z=I.current)==null?void 0:z.side)&&I9(Z,(Y=I.current)==null?void 0:Y.area)},[]);return g.jsx(S9,{scope:n,searchRef:P,onItemEnter:b.useCallback(Z=>{V(Z)&&Z.preventDefault()},[V]),onItemLeave:b.useCallback(Z=>{var N;V(Z)||((N=j.current)==null||N.focus(),D(null))},[V]),onTriggerLeave:b.useCallback(Z=>{V(Z)&&Z.preventDefault()},[V]),pointerGraceTimerRef:W,onPointerGraceIntentChange:b.useCallback(Z=>{I.current=Z},[]),children:g.jsx(H,{...B,children:g.jsx(Uu,{asChild:!0,trapped:s,onMountAutoFocus:Re(l,Z=>{var N;Z.preventDefault(),(N=j.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(La,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,children:g.jsx(u9,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:D,onEntryFocus:Re(h,Z=>{k.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(fp,{role:"menu","aria-orientation":"vertical","data-state":FM(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:F,style:{outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,Z=>{const z=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,Y=Z.ctrlKey||Z.altKey||Z.metaKey,A=Z.key.length===1;z&&(Z.key==="Tab"&&Z.preventDefault(),!Y&&A&&q(Z.key));const oe=j.current;if(Z.target!==oe||!f9.includes(Z.key))return;Z.preventDefault();const se=M().filter(J=>!J.disabled).map(J=>J.ref.current);yM.includes(Z.key)&&se.reverse(),j9(se)}),onBlur:Re(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(G.current),P.current="")}),onPointerMove:Re(e.onPointerMove,Ou(Z=>{const N=Z.target,z=U.current!==Z.clientX;if(Z.currentTarget.contains(N)&&z){const Y=Z.clientX>U.current?"right":"left";$.current=Y,U.current=Z.clientX}}))})})})})})})});kM.displayName=Wr;var E9="MenuGroup",Kb=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{role:"group",...r,ref:t})});Kb.displayName=E9;var R9="MenuLabel",EM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{...r,ref:t})});EM.displayName=R9;var jf="MenuItem",ZC="menu.itemSelect",wp=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=b.useRef(null),a=Qu(jf,e.__scopeMenu),u=Vb(jf,e.__scopeMenu),h=ht(t,l),d=b.useRef(!1),p=()=>{const m=l.current;if(!n&&m){const _=new CustomEvent(ZC,{bubbles:!0,cancelable:!0});m.addEventListener(ZC,y=>r==null?void 0:r(y),{once:!0}),SR(m,_),_.defaultPrevented?d.current=!1:a.onClose()}};return g.jsx(RM,{...s,ref:h,disabled:n,onClick:Re(e.onClick,p),onPointerDown:m=>{var _;(_=e.onPointerDown)==null||_.call(e,m),d.current=!0},onPointerUp:Re(e.onPointerUp,m=>{var _;d.current||(_=m.currentTarget)==null||_.click()}),onKeyDown:Re(e.onKeyDown,m=>{const _=u.searchRef.current!=="";n||_&&m.key===" "||N_.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});wp.displayName=jf;var RM=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,a=Vb(jf,n),u=xM(n),h=b.useRef(null),d=ht(t,h),[p,m]=b.useState(!1),[_,y]=b.useState("");return b.useEffect(()=>{const S=h.current;S&&y((S.textContent??"").trim())},[l.children]),g.jsx(Du.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:g.jsx(d9,{asChild:!0,...u,focusable:!r,children:g.jsx(et.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:Re(e.onPointerMove,Ou(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Ou(S=>a.onItemLeave(S))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})}),T9="MenuCheckboxItem",TM=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(OM,{scope:e.__scopeMenu,checked:n,children:g.jsx(wp,{role:"menuitemcheckbox","aria-checked":zf(n)?"mixed":n,...s,ref:t,"data-state":Yb(n),onSelect:Re(s.onSelect,()=>r==null?void 0:r(zf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});TM.displayName=T9;var MM="MenuRadioGroup",[M9,N9]=ul(MM,{value:void 0,onValueChange:()=>{}}),NM=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=oi(r);return g.jsx(M9,{scope:e.__scopeMenu,value:n,onValueChange:l,children:g.jsx(Kb,{...s,ref:t})})});NM.displayName=MM;var AM="MenuRadioItem",DM=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=N9(AM,e.__scopeMenu),l=n===s.value;return g.jsx(OM,{scope:e.__scopeMenu,checked:l,children:g.jsx(wp,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":Yb(l),onSelect:Re(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});DM.displayName=AM;var Gb="MenuItemIndicator",[OM,A9]=ul(Gb,{checked:!1}),LM=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=A9(Gb,n);return g.jsx(Kr,{present:r||zf(l.checked)||l.checked===!0,children:g.jsx(et.span,{...s,ref:t,"data-state":Yb(l.checked)})})});LM.displayName=Gb;var D9="MenuSeparator",jM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});jM.displayName=D9;var O9="MenuArrow",zM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sp(n);return g.jsx(pp,{...s,...r,ref:t})});zM.displayName=O9;var L9="MenuSub",[qee,PM]=ul(L9),iu="MenuSubTrigger",BM=b.forwardRef((e,t)=>{const n=dl(iu,e.__scopeMenu),r=Qu(iu,e.__scopeMenu),s=PM(iu,e.__scopeMenu),l=Vb(iu,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=l,d={__scopeMenu:e.__scopeMenu},p=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>p,[p]),b.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),h(null)}},[u,h]),g.jsx($b,{asChild:!0,...d,children:g.jsx(RM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":FM(n.open),...e,ref:ob(t,s.onTriggerChange),onClick:m=>{var _;(_=e.onClick)==null||_.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Ou(m=>{l.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Re(e.onPointerLeave,Ou(m=>{var y,S;p();const _=(y=n.content)==null?void 0:y.getBoundingClientRect();if(_){const w=(S=n.content)==null?void 0:S.dataset.side,C=w==="right",k=C?-5:5,T=_[C?"left":"right"],R=_[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:m.clientX+k,y:m.clientY},{x:T,y:_.top},{x:R,y:_.top},{x:R,y:_.bottom},{x:T,y:_.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(m),m.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,m=>{var y;const _=l.searchRef.current!=="";e.disabled||_&&m.key===" "||p9[r.dir].includes(m.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),m.preventDefault())})})})});BM.displayName=iu;var IM="MenuSubContent",HM=b.forwardRef((e,t)=>{const n=wM(Wr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=dl(Wr,e.__scopeMenu),a=Qu(Wr,e.__scopeMenu),u=PM(IM,e.__scopeMenu),h=b.useRef(null),d=ht(t,h);return g.jsx(Du.Provider,{scope:e.__scopeMenu,children:g.jsx(Kr,{present:r||l.open,children:g.jsx(Du.Slot,{scope:e.__scopeMenu,children:g.jsx(qb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;a.isUsingKeyboardRef.current&&((m=h.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Re(e.onFocusOutside,p=>{p.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{var y;const m=p.currentTarget.contains(p.target),_=m9[a.dir].includes(p.key);m&&_&&(l.onOpenChange(!1),(y=u.trigger)==null||y.focus(),p.preventDefault())})})})})})});HM.displayName=IM;function FM(e){return e?"open":"closed"}function zf(e){return e==="indeterminate"}function Yb(e){return zf(e)?"indeterminate":e?"checked":"unchecked"}function j9(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function P9(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=z9(e,Math.max(l,0));s.length===1&&(a=a.filter(d=>d!==n));const h=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function B9(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,p=u.y,m=h.x,_=h.y;p>r!=_>r&&n<(m-d)*(r-p)/(_-p)+d&&(s=!s)}return s}function I9(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return B9(n,t)}function Ou(e){return t=>t.pointerType==="mouse"?e(t):void 0}var H9=SM,F9=$b,U9=CM,$9=kM,W9=Kb,V9=EM,q9=wp,K9=TM,G9=NM,Y9=DM,X9=LM,Z9=jM,Q9=zM,J9=BM,eH=HM,Xb="ContextMenu",[tH]=ms(Xb,[bM]),qn=bM(),[nH,UM]=tH(Xb),$M=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:l=!0}=e,[a,u]=b.useState(!1),h=qn(t),d=oi(r),p=b.useCallback(m=>{u(m),d(m)},[d]);return g.jsx(nH,{scope:t,open:a,onOpenChange:p,modal:l,children:g.jsx(H9,{...h,dir:s,open:a,onOpenChange:p,modal:l,children:n})})};$M.displayName=Xb;var WM="ContextMenuTrigger",VM=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,l=UM(WM,n),a=qn(n),u=b.useRef({x:0,y:0}),h=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=b.useRef(0),p=b.useCallback(()=>window.clearTimeout(d.current),[]),m=_=>{u.current={x:_.clientX,y:_.clientY},l.onOpenChange(!0)};return b.useEffect(()=>p,[p]),b.useEffect(()=>void(r&&p()),[r,p]),g.jsxs(g.Fragment,{children:[g.jsx(F9,{...a,virtualRef:h}),g.jsx(et.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Re(e.onContextMenu,_=>{p(),m(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Re(e.onPointerDown,Lh(_=>{p(),d.current=window.setTimeout(()=>m(_),700)})),onPointerMove:r?e.onPointerMove:Re(e.onPointerMove,Lh(p)),onPointerCancel:r?e.onPointerCancel:Re(e.onPointerCancel,Lh(p)),onPointerUp:r?e.onPointerUp:Re(e.onPointerUp,Lh(p))})]})});VM.displayName=WM;var rH="ContextMenuPortal",qM=e=>{const{__scopeContextMenu:t,...n}=e,r=qn(t);return g.jsx(U9,{...r,...n})};qM.displayName=rH;var KM="ContextMenuContent",GM=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=UM(KM,n),l=qn(n),a=b.useRef(!1);return g.jsx($9,{...l,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&a.current&&u.preventDefault(),a.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(a.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)"}})});GM.displayName=KM;var iH="ContextMenuGroup",sH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(W9,{...s,...r,ref:t})});sH.displayName=iH;var oH="ContextMenuLabel",lH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(V9,{...s,...r,ref:t})});lH.displayName=oH;var aH="ContextMenuItem",YM=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(q9,{...s,...r,ref:t})});YM.displayName=aH;var cH="ContextMenuCheckboxItem",uH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(K9,{...s,...r,ref:t})});uH.displayName=cH;var dH="ContextMenuRadioGroup",hH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(G9,{...s,...r,ref:t})});hH.displayName=dH;var fH="ContextMenuRadioItem",pH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Y9,{...s,...r,ref:t})});pH.displayName=fH;var mH="ContextMenuItemIndicator",gH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(X9,{...s,...r,ref:t})});gH.displayName=mH;var vH="ContextMenuSeparator",_H=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Z9,{...s,...r,ref:t})});_H.displayName=vH;var yH="ContextMenuArrow",bH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Q9,{...s,...r,ref:t})});bH.displayName=yH;var xH="ContextMenuSubTrigger",SH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(J9,{...s,...r,ref:t})});SH.displayName=xH;var wH="ContextMenuSubContent",CH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(eH,{...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)"}})});CH.displayName=wH;function Lh(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var kH=$M,EH=VM,RH=qM,XM=GM,ZM=YM;const TH=kH,MH=EH,QM=b.forwardRef(({className:e,...t},n)=>g.jsx(RH,{children:g.jsx(XM,{ref:n,className:ye("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg 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})}));QM.displayName=XM.displayName;const JM=b.forwardRef(({className:e,...t},n)=>g.jsx(ZM,{ref:n,className:ye("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}));JM.displayName=ZM.displayName;function NH({onRemove:e,children:t}){return g.jsxs(TH,{children:[g.jsx(MH,{asChild:!0,children:t}),g.jsx(QM,{children:g.jsxs(JM,{onSelect:n=>{n.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:[g.jsx(rB,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function AH({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:d,startingLocalPath:p}){const{groupKey:m,localPath:_,chats:y}=e,S=n.has(m),w=S?y:y.slice(0,a),C=y.length>a,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:M,transform:O,transition:D,isDragging:j}=Z7({id:m}),F={transform:Nu.Translate.toString(O),transition:D},G=g.jsxs("div",{ref:M,className:ye("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between","cursor-grab active:cursor-grabbing",j&&"cursor-grabbing"),onClick:()=>r(m),...T,children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:t.has(m)?g.jsx(ds,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):g.jsxs(g.Fragment,{children:[g.jsx(JR,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 text-slate-400 dark:text-slate-500 transition-all duration-200 group-hover/section:opacity-0"}),g.jsx(ds,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 rotate-90 text-slate-400 opacity-0 transition-all duration-200 group-hover/section:opacity-100"})]})}),g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:KT(_)})}),g.jsx(Tu,{side:"right",sideOffset:4,children:_})]})]}),u&&g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",className:ye("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!d||p===_)&&"opacity-50 cursor-not-allowed"),disabled:!d||p===_,onClick:P=>{P.stopPropagation(),u(_)},children:p===_?g.jsx(Mi,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):g.jsx(pb,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Tu,{side:"right",sideOffset:4,children:d?"New chat":`Start ${$n} to connect`})]})]});return g.jsxs("div",{ref:R,style:F,className:ye("group/section",j&&"opacity-50 shadow-lg z-50 relative"),...k,children:[h?g.jsx(NH,{onRemove:()=>h(m),children:G}):G,!t.has(m)&&(w.length>0||C)&&g.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(l),C&&g.jsx("button",{onClick:()=>s(m),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:S?"Show less":`Show more (${y.length-a})`})]})]})}function DH({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,onReorderGroups:d,isConnected:p,startingLocalPath:m}){const _=R8(IC(Ib,{activationConstraint:{distance:8}}),IC(Pb)),y=b.useMemo(()=>e.map(k=>k.groupKey),[e]),S=b.useRef(null);function w(k){const T=k.active.id;t.has(T)?S.current=null:(S.current=T,r(T))}function C(k){const{active:T,over:R}=k;if(R&&T.id!==R.id&&d){const M=y.indexOf(T.id),O=y.indexOf(R.id);if(M!==-1&&O!==-1){const D=Hb(y,M,O);d(D)}}if(S.current){const M=S.current;S.current=null,requestAnimationFrame(()=>r(M))}}return g.jsx(A7,{sensors:_,collisionDetection:D8,onDragStart:w,onDragEnd:C,children:g.jsx(W7,{items:y,strategy:U7,children:e.map(k=>g.jsx(AH,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:p,startingLocalPath:m},k.groupKey))})})}const QC=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const _=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,_))}},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},OH=(e=>e?QC(e):QC),LH=e=>e;function jH(e,t=LH){const n=Et.useSyncExternalStore(e.subscribe,Et.useCallback(()=>t(e.getState()),[e,t]),Et.useCallback(()=>t(e.getInitialState()),[e,t]));return Et.useDebugValue(n),n}const zH=e=>{const t=OH(e),n=r=>jH(t,r);return Object.assign(n,t),n},Ua=(e=>zH);function PH(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const a=h=>h===null?null:JSON.parse(h,void 0),u=(l=n.getItem(s))!=null?l:null;return u instanceof Promise?u.then(a):a(u)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const A_=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return A_(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return A_(r)(n)}}}},BH=(e,t)=>(n,r,s)=>{let l={storage:PH(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},a=!1,u=0;const h=new Set,d=new Set;let p=l.storage;if(!p)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...C)},r,s);const m=()=>{const C=l.partialize({...r()});return p.setItem(l.name,{state:C,version:l.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),m());const y=e((...C)=>(n(...C),m()),r,s);s.getInitialState=()=>y;let S;const w=()=>{var C,k;if(!p)return;const T=++u;a=!1,h.forEach(M=>{var O;return M((O=r())!=null?O:y)});const R=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(C=r())!=null?C:y))||void 0;return A_(p.getItem.bind(p))(l.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==l.version){if(l.migrate){const O=l.migrate(M.state,M.version);return O instanceof Promise?O.then(D=>[!0,D]):[!0,O]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var O;if(T!==u)return;const[D,j]=M;if(S=l.merge(j,(O=r())!=null?O:y),n(S,!0),D)return m()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),a=!0,d.forEach(M=>M(S)))}).catch(M=>{T===u&&(R==null||R(void 0,M))})};return s.persist={setOptions:C=>{l={...l,...C},C.storage&&(p=C.storage)},clearStorage:()=>{p==null||p.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>w(),hasHydrated:()=>a,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},l.skipHydration||w(),S||y},$a=BH,JC=Ua()($a(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function IH({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:l,showMobileOpenButton:a,onOpen:u,onClose:h,onCollapse:d,onExpand:p,onCreateChat:m,onDeleteChat:_,onRemoveProject:y,updateSnapshot:S,onInstallUpdate:w}){const C=ui(),k=Oa(),T=b.useRef(null),[R,M]=b.useState(new Set),[O,D]=b.useState(new Set),[j,F]=b.useState(()=>Date.now()),G=10,P=JC(ie=>ie.order),W=JC(ie=>ie.setOrder),I=b.useMemo(()=>{if(P.length===0)return e.projectGroups;const ie=new Map(e.projectGroups.map(Se=>[Se.groupKey,Se])),ce=P.filter(Se=>ie.has(Se)).map(Se=>ie.get(Se)),we=new Set(P);for(const Se of e.projectGroups)we.has(Se.groupKey)||ce.push(Se);return ce},[e.projectGroups,P]),$=b.useCallback(ie=>W(ie),[W]),U=b.useMemo(()=>new Map(e.projectGroups.map(ie=>[ie.localPath,ie.groupKey])),[e.projectGroups]),H=b.useMemo(()=>e.projectGroups.reduce((ie,ce)=>ie+ce.chats.length,0),[e.projectGroups]),B=b.useCallback(ie=>{M(ce=>{const we=new Set(ce);return we.has(ie)?we.delete(ie):we.add(ie),we})},[]),q=b.useCallback(ie=>{D(ce=>{const we=new Set(ce);return we.has(ie)?we.delete(ie):we.add(ie),we})},[]),V=b.useCallback(ie=>g.jsx(h8,{chat:ie,activeChatId:t,nowMs:j,onSelectChat:ce=>{k(`/chat/${ce}`),h()},onDeleteChat:()=>_(ie)},ie._id),[t,k,j,h,_]);b.useEffect(()=>{const ie=window.setInterval(()=>{F(Date.now())},3e4);return()=>window.clearInterval(ie)},[]),b.useEffect(()=>{!t||!T.current||requestAnimationFrame(()=>{const ie=T.current,ce=ie==null?void 0:ie.querySelector(`[data-chat-id="${t}"]`);if(!ce||!ie)return;const we=ce.getBoundingClientRect(),Se=ie.getBoundingClientRect();if(we.top<Se.top+38){const ke=we.top-Se.top+ie.scrollTop;ie.scrollTo({top:ke-38,behavior:"smooth"})}else if(we.bottom>Se.bottom){const ke=we.top+we.height/2-Se.top+ie.scrollTop,Be=ie.clientHeight/2;ie.scrollTo({top:ke-Be,behavior:"smooth"})}})},[t,H]);const Z=H>0,N=C.pathname==="/",z=C.pathname.startsWith("/settings"),Y=N||z,A=n==="connecting"||!r,oe=A?"Connecting":n==="connected"?"Connected":"Disconnected",fe=n==="connected"?"bg-emerald-500":"bg-amber-500",se=(S==null?void 0:S.updateAvailable)===!0,J=S?S.latestVersion===`${S.currentVersion}-dev`:!1,ge=(S==null?void 0:S.status)==="updating"||(S==null?void 0:S.status)==="restart_pending";return g.jsxs(g.Fragment,{children:[!s&&a&&g.jsx(rt,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:g.jsx(db,{className:"h-5 w-5"})}),l&&Y&&g.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:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(pu,{className:"size-6 text-logo"}),g.jsx(rt,{variant:"ghost",size:"icon",onClick:p,title:"Expand sidebar",children:g.jsx(v_,{className:"h-5 w-5"})})]})}),g.jsxs("div",{"data-sidebar":"open",className:ye("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",l&&"md:hidden"),children:[g.jsxs("div",{className:" pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{type:"button",onClick:d,title:"Collapse sidebar",className:"hidden md:flex group/sidebar-collapse relative items-center justify-center h-5 w-5 sm:h-6 sm:w-6",children:[g.jsx(pu,{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"}),g.jsx(v_,{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"})]}),g.jsx(pu,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),g.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:$n})]}),g.jsxs("div",{className:"flex items-center",children:[J?g.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"}):se?g.jsxs(rt,{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:w,disabled:ge,title:S!=null&&S.latestVersion?`Update to ${S.latestVersion}`:"Update Kanna",children:[ge?g.jsx(Mi,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>{k("/"),h()},className:"size-10 rounded-lg",title:"New project",children:g.jsx(fb,{className:"size-4"})}),g.jsx(rt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:h,children:g.jsx(za,{className:"h-5 w-5"})})]})]}),g.jsx("div",{ref:T,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:g.jsxs("div",{className:"p-[7px]",children:[!Z&&A?g.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(ie=>g.jsxs("div",{className:"space-y-2 animate-pulse",children:[g.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),g.jsx("div",{className:"space-y-1",children:[0,1,2].map(ce=>g.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[g.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),g.jsx("div",{className:ye("h-3.5 rounded bg-muted",ce===0?"w-32":ce===1?"w-40":"w-28")})]},ce))})]},ie))}):null,!Z&&!A&&e.projectGroups.length===0?g.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,g.jsx(DH,{projectGroups:I,onReorderGroups:$,collapsedSections:R,expandedGroups:O,onToggleSection:B,onToggleExpandedGroup:q,renderChatRow:V,chatsPerProject:G,onNewLocalChat:ie=>{const ce=U.get(ie);ce&&m(ce)},onRemoveProject:y,isConnected:n==="connected"})]})}),g.jsx("div",{className:"border-t border-border p-2",children:g.jsx("button",{type:"button",onClick:()=>{k("/settings/general"),h()},className:ye("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",z?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:g.jsxs("div",{className:"flex items- justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(HP,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:"Settings"})]}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:oe}),A?g.jsx(Mi,{className:"h-2 w-2 animate-spin"}):g.jsx("span",{className:ye("h-2 w-2 rounded-full",fe)})]})]})})})]}),s?g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:h}):null]})}const Pf=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],D_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],Cp={reasoningEffort:"high",contextWindow:"200k"},O_={reasoningEffort:"high",fastMode:!1};function ek(e){return Pf.some(t=>t.id===e)}function tk(e){return D_.some(t=>t.id===e)}const L_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}],_u=[{id:"claude",label:"Claude",defaultModel:"sonnet",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...L_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...L_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Pf]},{id:"codex",label:"Codex",defaultModel:"gpt-5.4",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:[]}];function HH(e){const t=_u.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function FH(e){return HH("claude").models.find(t=>t.id===e)}function UH(e){var t;return((t=FH(e))==null?void 0:t.contextWindowOptions)??[]}function j_(e,t){const n=UH(e);if(n.length!==0)return n.some(r=>r.id===t)?t:Cp.contextWindow}const no={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+/"]},eN=b.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ye("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}));eN.displayName="Textarea";function $H(){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 WH=Ua()($a((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:l,...a}=s.drafts;return{drafts:a}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...l}=r.drafts;return{drafts:l}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));function VH(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function qH(e){return e==="claude"||e==="codex"?e:"last_used"}function Go(e){var l,a;const t=(l=e==null?void 0:e.modelOptions)==null?void 0:l.reasoningEffort,n=ek(t)?t:ek(e==null?void 0:e.effort)?e.effort:Cp.reasoningEffort,r=(e==null?void 0:e.model)??"opus",s=j_(r,(a=e==null?void 0:e.modelOptions)==null?void 0:a.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,...s?{contextWindow:s}:{}},planMode:!!(e!=null&&e.planMode)}}function Yo(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:VH(e==null?void 0:e.model),modelOptions:{reasoningEffort:tk(t)?t:tk(e==null?void 0:e.effort)?e.effort:O_.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:O_.fastMode},planMode:!!(e!=null&&e.planMode)}}function KH(){return{claude:{model:"opus",modelOptions:{...Cp},planMode:!1},codex:{model:"gpt-5.4",modelOptions:{...O_},planMode:!1}}}function GH(e){return{claude:Go(e==null?void 0:e.claude),codex:Yo(e==null?void 0:e.codex)}}function nk(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function z_(e,t){if(e==="claude"){const r=t.claude;return{provider:"claude",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 YH(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=Go(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Yo(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=Go(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Yo(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return z_("claude",t)}function XH(e){const t=GH(e==null?void 0:e.providerDefaults);return{defaultProvider:qH(e==null?void 0:e.defaultProvider),providerDefaults:t,composerState:YH(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const ls=Ua()($a(e=>({defaultProvider:"last_used",providerDefaults:KH(),composerState:{provider:"claude",model:"opus",modelOptions:{...Cp},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Go({...r.providerDefaults.claude,model:n}):Yo({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Go({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):Yo({...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:Go({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:Yo({...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:Go({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Yo({...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:z_(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return nk("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=z_(t.defaultProvider,t.providerDefaults);return nk("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:3,migrate:e=>XH(e)}));var kp="Popover",[tN]=ms(kp,[po]),Ju=po(),[ZH,mo]=tN(kp),nN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!1}=e,u=Ju(t),h=b.useRef(null),[d,p]=b.useState(!1),[m,_]=wa({prop:r,defaultProp:s??!1,onChange:l,caller:kp});return g.jsx(hp,{...u,children:g.jsx(ZH,{scope:t,contentId:cs(),triggerRef:h,open:m,onOpenChange:_,onOpenToggle:b.useCallback(()=>_(y=>!y),[_]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>p(!0),[]),onCustomAnchorRemove:b.useCallback(()=>p(!1),[]),modal:a,children:n})})};nN.displayName=kp;var rN="PopoverAnchor",QH=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(rN,n),l=Ju(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return b.useEffect(()=>(a(),()=>u()),[a,u]),g.jsx(Vu,{...l,...r,ref:t})});QH.displayName=rN;var iN="PopoverTrigger",sN=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(iN,n),l=Ju(n),a=ht(t,s.triggerRef),u=g.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":uN(s.open),...r,ref:a,onClick:Re(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:g.jsx(Vu,{asChild:!0,...l,children:u})});sN.displayName=iN;var Zb="PopoverPortal",[JH,eF]=tN(Zb,{forceMount:void 0}),oN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=mo(Zb,t);return g.jsx(JH,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(ja,{asChild:!0,container:s,children:r})})})};oN.displayName=Zb;var Ea="PopoverContent",lN=b.forwardRef((e,t)=>{const n=eF(Ea,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=mo(Ea,e.__scopePopover);return g.jsx(Kr,{present:r||l.open,children:l.modal?g.jsx(nF,{...s,ref:t}):g.jsx(rF,{...s,ref:t})})});lN.displayName=Ea;var tF=Qo("PopoverContent.RemoveScroll"),nF=b.forwardRef((e,t)=>{const n=mo(Ea,e.__scopePopover),r=b.useRef(null),s=ht(t,r),l=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return sp(a)},[]),g.jsx($u,{as:tF,allowPinchZoom:!0,children:g.jsx(aN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),l.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),rF=b.forwardRef((e,t)=>{const n=mo(Ea,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return g.jsx(aN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),aN=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,...m}=e,_=mo(Ea,n),y=Ju(n);return rp(),g.jsx(Uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:g.jsx(La,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),children:g.jsx(fp,{"data-state":uN(_.open),role:"dialog",id:_.contentId,...y,...m,ref:t,style:{...m.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)"}})})})}),cN="PopoverClose",iF=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(cN,n);return g.jsx(et.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});iF.displayName=cN;var sF="PopoverArrow",oF=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ju(n);return g.jsx(pp,{...s,...r,ref:t})});oF.displayName=sF;function uN(e){return e?"open":"closed"}var lF=nN,aF=sN,cF=oN,dN=lN;const uF=lF,dF=aF,hN=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>g.jsx(cF,{children:g.jsx(dN,{ref:s,align:t,sideOffset:n,[ku]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event(wf)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},className:ye("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg 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})}));hN.displayName=dN.displayName;function hF({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:g.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 fF({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:g.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"})})}const rk={claude:hF,codex:fF},ik={opus:$o,sonnet:$o,haiku:$o,"gpt-5.4":$o,"gpt-5.3-codex":$o,"gpt-5.3-codex-spark":$o};function ns({onClick:e,selected:t,icon:n,label:r,description:s,disabled:l}){return g.jsxs("button",{onClick:e,disabled:l,className:ye("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",l&&"opacity-40 cursor-not-allowed"),children:[n,g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:r}),s?g.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function ra({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,l]=b.useState(!1);return n?g.jsx("button",{disabled:!0,className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap",t),children:e}):g.jsxs(uF,{open:s,onOpenChange:l,children:[g.jsx(dF,{asChild:!0,children:g.jsx("button",{className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap","hover:bg-muted/50",t),children:e})}),g.jsx(hN,{align:"center",className:"w-64 p-1",children:g.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>l(!1)):r})})]})}function P_({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,providerLocked:r=!1,model:s,modelOptions:l,onProviderChange:a,onModelChange:u,onClaudeReasoningEffortChange:h,onClaudeContextWindowChange:d,onCodexReasoningEffortChange:p,onCodexFastModeChange:m,planMode:_=!1,onPlanModeChange:y,includePlanMode:S=!0,className:w}){var G,P,W,I,$;const C=e.find(U=>U.id===t)??e[0],k=rk[t],T=ik[s]??$o,R=S&&(C==null?void 0:C.supportsPlanMode)&&y,M=t==="claude"?l:null,O=t==="codex"?l:null,D=((G=C.models.find(U=>U.id===s))==null?void 0:G.contextWindowOptions)??[],j=(M==null?void 0:M.contextWindow)??L_[0].id,F=j==="1m"?SC:wC;return g.jsxs("div",{className:ye("flex md:justify-center items-center gap-0.5",w),children:[n?g.jsx(ra,{disabled:r||!a,trigger:g.jsxs(g.Fragment,{children:[g.jsx(k,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:(C==null?void 0:C.label)??t})]}),children:U=>e.map(H=>{const B=rk[H.id];return g.jsx(ns,{onClick:()=>{a==null||a(H.id),U()},selected:t===H.id,icon:g.jsx(B,{className:"h-4 w-4 text-muted-foreground"}),label:H.label},H.id)})}):null,g.jsx(ra,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(T,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((P=C.models.find(U=>U.id===s))==null?void 0:P.label)??s})]}),children:U=>C.models.map(H=>{const B=ik[H.id]??rT;return g.jsx(ns,{onClick:()=>{u(t,H.id),U()},selected:s===H.id,icon:g.jsx(B,{className:"h-4 w-4 text-muted-foreground"}),label:H.label},H.id)})}),g.jsx(ra,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(mv,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:t==="claude"?((W=Pf.find(U=>U.id===l.reasoningEffort))==null?void 0:W.label)??l.reasoningEffort:((I=D_.find(U=>U.id===l.reasoningEffort))==null?void 0:I.label)??l.reasoningEffort})]}),children:U=>t==="claude"?Pf.map(H=>g.jsx(ns,{onClick:()=>{h(H.id),U()},selected:l.reasoningEffort===H.id,icon:g.jsx(mv,{className:"h-4 w-4 text-muted-foreground"}),label:H.label,disabled:H.id==="max"&&s!=="opus"},H.id)):D_.map(H=>g.jsx(ns,{onClick:()=>{p(H.id),U()},selected:l.reasoningEffort===H.id,icon:g.jsx(mv,{className:"h-4 w-4 text-muted-foreground"}),label:H.label},H.id))}),t==="claude"&&D.length>1?g.jsx(ra,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(F,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:(($=D.find(U=>U.id===j))==null?void 0:$.label)??j})]}),children:U=>D.map(H=>g.jsx(ns,{onClick:()=>{d(H.id),U()},selected:j===H.id,icon:H.id==="1m"?g.jsx(SC,{className:"h-4 w-4 text-muted-foreground"}):g.jsx(wC,{className:"h-4 w-4 text-muted-foreground"}),label:H.label,description:H.id==="1m"?"Expanded context window":"Standard context window"},H.id))}):null,t==="codex"?g.jsx(ra,{trigger:g.jsxs(g.Fragment,{children:[O!=null&&O.fastMode?g.jsx(Mh,{className:"h-3.5 w-3.5"}):g.jsx(Mh,{className:"h-3.5 w-3.5 -scale-x-100"}),g.jsx("span",{children:O!=null&&O.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:O!=null&&O.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:U=>g.jsxs(g.Fragment,{children:[g.jsx(ns,{onClick:()=>{m(!1),U()},selected:!(O!=null&&O.fastMode),icon:g.jsx(Mh,{className:"h-4 w-4 text-muted-foreground -scale-x-100"}),label:"Standard"}),g.jsx(ns,{onClick:()=>{m(!0),U()},selected:!!(O!=null&&O.fastMode),icon:g.jsx(Mh,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,R?g.jsx(ra,{trigger:g.jsxs(g.Fragment,{children:[_?g.jsx(Sf,{className:"h-3.5 w-3.5"}):g.jsx(bC,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:_?"Plan Mode":"Full Access"})]}),triggerClassName:_?"text-blue-400 dark:text-blue-300":void 0,children:U=>g.jsxs(g.Fragment,{children:[g.jsx(ns,{onClick:()=>{y(!1),U()},selected:!_,icon:g.jsx(bC,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),g.jsx(ns,{onClick:()=>{y(!0),U()},selected:_,icon:g.jsx(Sf,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})}function sk(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function Qs(e,t,n){return e==="claude"?t.provider==="claude"?{provider:"claude",model:t.model,modelOptions:{...t.modelOptions},planMode:t.planMode}:{provider:"claude",model:n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:n.claude.planMode}:t.provider==="codex"?{provider:"codex",model:t.model,modelOptions:{...t.modelOptions},planMode:t.planMode}:{provider:"codex",model:n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:n.codex.planMode}}function pF(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??Qs(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const mF=b.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:l,activeProvider:a,availableProviders:u},h){const{getDraft:d,setDraft:p,clearDraft:m}=WH(),{composerState:_,providerDefaults:y,setComposerModel:S,setComposerModelOptions:w,setComposerPlanMode:C,resetComposerFromProvider:k}=ls(),[T,R]=b.useState(()=>l?d(l):""),M=b.useRef(null),O=$H(),[D,j]=b.useState(()=>a?Qs(a,_,y):null),F=a!==null,G=F?D??Qs(a,_,y):_,P=F?a:_.provider,W=u.find(z=>z.id===P)??u[0],I=(W==null?void 0:W.supportsPlanMode)??!1,$=b.useCallback(()=>{const z=M.current;if(z){if(z.value.length===0){z.style.height="";return}z.style.height="auto",z.style.height=`${z.scrollHeight}px`}},[]),U=b.useCallback(z=>{if(M.current=z,!!h){if(typeof h=="function"){h(z);return}h.current=z}},[h]);b.useLayoutEffect(()=>{$()},[T,$]),b.useEffect(()=>(window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)),[$]),b.useEffect(()=>{var z;(z=M.current)==null||z.focus()},[l]),b.useEffect(()=>{if(a===null){j(null);return}j(Qs(a,_,y))},[a,l]),b.useEffect(()=>{sk("resolved provider state",{chatId:l??null,activeProvider:a,composerProvider:_.provider,composerModel:_.model,effectiveProvider:G.provider,effectiveModel:G.model,selectedProvider:P,providerLocked:F,lockedComposerProvider:(D==null?void 0:D.provider)??null})},[a,l,_.model,_.provider,D==null?void 0:D.provider,F,G.model,G.provider,P]);function H(z){if(F){j(Y=>{const A=Y??Qs(P,_,y);return A.provider==="claude"?{...A,modelOptions:{...A.modelOptions,reasoningEffort:z}}:{...A,modelOptions:{...A.modelOptions,reasoningEffort:z}}});return}if(P==="claude"){w({reasoningEffort:z});return}w({reasoningEffort:z})}function B(z){if(F){j(Y=>{const A=Y??Qs(P,_,y);if(A.provider!=="claude")return A;const oe=j_(A.model,z),{contextWindow:fe,...se}=A.modelOptions;return{...A,modelOptions:{...se,...oe?{contextWindow:oe}:{}}}});return}w({contextWindow:z})}function q(z){const Y=pF({providerLocked:F,planMode:z,selectedProvider:P,composerState:_,providerDefaults:y,lockedComposerState:D});Y.lockedComposerState!==D&&j(Y.lockedComposerState),Y.composerPlanMode!==_.planMode&&C(Y.composerPlanMode)}function V(){q(!G.planMode)}async function Z(){if(!T.trim())return;const z=T;let Y;G.provider==="claude"?Y={claude:{...G.modelOptions}}:Y={codex:{...G.modelOptions}};const A={provider:P,model:G.model,modelOptions:Y,planMode:I?G.planMode:!1};sk("submit settings",{chatId:l??null,activeProvider:a,composerProvider:G.provider,submitOptions:A}),R(""),l&&m(l),M.current&&(M.current.style.height="auto");try{await t(z,A)}catch(oe){console.error("[ChatInput] Submit failed:",oe),R(z),l&&p(l,z)}}function N(z){if(z.key==="Tab"&&!z.shiftKey){z.preventDefault(),aB(M.current,document);return}if(z.key==="Tab"&&z.shiftKey&&I){z.preventDefault(),V();return}if(z.key==="Escape"&&s){z.preventDefault(),n==null||n();return}const Y="ontouchstart"in window||navigator.maxTouchPoints>0;z.key==="Enter"&&!z.shiftKey&&!s&&!Y&&(z.preventDefault(),Z())}return g.jsxs("div",{children:[g.jsx("div",{className:ye("px-3 pt-0",O&&"px-5"),children:g.jsxs("div",{className:"flex items-end gap-2 max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[g.jsx(eN,{ref:U,placeholder:"Build something...",value:T,autoFocus:!0,[vb]:"",rows:1,onChange:z=>{R(z.target.value),l&&p(l,z.target.value),$()},onKeyDown:N,disabled:r,className:"flex-1 text-base p-3 md:p-4 pl-4.5 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),g.jsx(rt,{type:"button",onPointerDown:z=>{z.preventDefault(),s?n==null||n():!r&&T.trim()&&Z()},disabled:!s&&(r||!T.trim()),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 mb-1 -mr-0.5 md:mr-0 md:mb-1.5 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?g.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):g.jsx(w6,{className:"h-5 w-5 md:h-6 md:w-6"})})]})}),g.jsxs("div",{className:ye("overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden py-3 flex flex-row",O&&"p-5 pt-3"),children:[g.jsx("div",{className:"min-w-3"}),g.jsx(P_,{availableProviders:u,selectedProvider:P,providerLocked:F,model:G.model,modelOptions:G.modelOptions,onProviderChange:z=>{F||k(z)},onModelChange:(z,Y)=>{if(F){j(A=>{const oe=A??Qs(P,_,y);if(oe.provider==="claude"){const fe=j_(Y,oe.modelOptions.contextWindow),{contextWindow:se,...J}=oe.modelOptions;return{...oe,model:Y,modelOptions:{...J,...fe?{contextWindow:fe}:{}}}}return{...oe,model:Y}});return}S(Y)},onClaudeReasoningEffortChange:z=>H(z),onClaudeContextWindowChange:z=>B(z),onCodexReasoningEffortChange:z=>H(z),onCodexFastModeChange:z=>{if(F){j(Y=>{const A=Y??Qs(P,_,y);return A.provider==="claude"?A:{...A,modelOptions:{...A.modelOptions,fastMode:z}}});return}w({fastMode:z})},planMode:G.planMode,onPlanModeChange:q,includePlanMode:I,className:"max-w-[840px] mx-auto"}),g.jsx("div",{className:"min-w-3"})]})]})}),gF=b.memo(mF),fN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("bg-card text-card-foreground",e),...t}));fN.displayName="Card";const pN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-2",e),...t}));pN.displayName="CardHeader";const vF=b.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));vF.displayName="CardTitle";const _F=b.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));_F.displayName="CardDescription";const mN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));mN.displayName="CardContent";const yF=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));yF.displayName="CardFooter";function bF({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:a,rightSidebarVisible:u=!1,onToggleRightSidebar:h,onOpenExternal:d,editorLabel:p="Editor",finderShortcut:m,editorShortcut:_,terminalShortcut:y,rightSidebarShortcut:S}){return g.jsx(pN,{className:ye("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:g.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[g.jsxs("div",{className:`flex items-center gap-1 flex-shrink-0 border border-border rounded-full ${e?"px-1.5":""} p-1 backdrop-blur-lg`,children:[g.jsx(rt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:g.jsx(db,{className:"size-4.5"})}),e&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center justify-center w-[36px] h-[36px]",children:g.jsx(pu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),g.jsx(rt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:g.jsx(v_,{className:"size-4.5"})})]}),g.jsx(rt,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:g.jsx(pb,{className:"size-4.5"})})]}),g.jsx("div",{className:"flex-1 min-w-0"}),g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border border-border rounded-full px-1.5 py-1 backdrop-blur-lg",children:[s&&(d||a)&&g.jsxs(g.Fragment,{children:[d?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>d("open_finder"),title:"Open in Finder",className:"border border-border/0",children:g.jsx(JR,{className:"h-4.5 w-4.5"})})}),g.jsx(ha,{side:"bottom",shortcut:m})]}):null,a?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:a,className:ye("border border-border/0",l&&"text-white"),children:g.jsx(mb,{className:"h-4.5 w-4.5"})})}),g.jsx(ha,{side:"bottom",shortcut:y})]}):null,d?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>d("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:g.jsx(QR,{className:"h-4.5 w-4.5"})})}),g.jsx(ha,{side:"bottom",shortcut:_})]}):null]}),h?g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:h,className:ye("border border-border/0",u&&"text-white"),children:g.jsx(AP,{className:"h-4.5 w-4.5"})})}),g.jsx(ha,{side:"bottom",shortcut:S})]}):null]})]})})}function xF({onClose:e}){return g.jsx("div",{className:"h-full min-h-0 border-l border-border bg-background md:min-w-[300px]",children:g.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[g.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[g.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),g.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:g.jsx(za,{className:"h-4 w-4"})})]}),g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:g.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function SF(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function wF(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function CF(e){return e/100*window.innerHeight}function kF(e){return e/100*window.innerWidth}function EF(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 su({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,l]=EF(n);switch(l){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=wF(t,s);break}case"em":{r=SF(t,s);break}case"vh":{r=CF(s);break}case"vw":{r=kF(s);break}}return r}function or(e){return parseFloat(e.toFixed(3))}function Ra({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 B_(e){const{panels:t}=e,n=Ra({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:l}=r;let a=0;if(l.collapsedSize!==void 0){const p=su({groupSize:n,panelElement:s,styleProp:l.collapsedSize});a=or(p/n*100)}let u;if(l.defaultSize!==void 0){const p=su({groupSize:n,panelElement:s,styleProp:l.defaultSize});u=or(p/n*100)}let h=0;if(l.minSize!==void 0){const p=su({groupSize:n,panelElement:s,styleProp:l.minSize});h=or(p/n*100)}let d=100;if(l.maxSize!==void 0){const p=su({groupSize:n,panelElement:s,styleProp:l.maxSize});d=or(p/n*100)}return{groupResizeBehavior:l.groupResizeBehavior,collapsedSize:a,collapsible:l.collapsible===!0,defaultSize:u,disabled:l.disabled,minSize:h,maxSize:d,panelId:r.id}})}function yt(e,t="Assertion error"){if(!e)throw Error(t)}function I_(e,t){return Array.from(t).sort(e==="horizontal"?RF:TF)}function RF(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function TF(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function gN(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function vN(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 MF({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,l=Number.MAX_VALUE;for(const a of t){const{x:u,y:h}=vN(r,a),d=e==="horizontal"?u:h;d<l&&(l=d,s=a)}return yt(s,"No rect found"),s}let jh;function NF(){return jh===void 0&&(typeof matchMedia=="function"?jh=!!matchMedia("(pointer:coarse)").matches:jh=!1),jh}function _N(e){const{element:t,orientation:n,panels:r,separators:s}=e,l=I_(n,Array.from(t.children).filter(gN).map(S=>({element:S}))).map(({element:S})=>S),a=[];let u=!1,h=!1,d=-1,p=-1,m=0,_,y=[];{let S=-1;for(const w of l)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(m++,d===-1&&(d=S),p=S))}if(m>1){let S=-1;for(const w of l)if(w.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===w);if(C){if(_){const k=_.element.getBoundingClientRect(),T=w.getBoundingClientRect();let R;if(h){const M=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),O=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(y.length){case 0:{R=[M,O];break}case 1:{const D=y[0],j=MF({orientation:n,rects:[k,T],targetRect:D.element.getBoundingClientRect()});R=[D,j===k?O:M];break}default:{R=y;break}}}else y.length?R=y:R=[n==="horizontal"?new DOMRect(k.right,T.top,T.left-k.right,T.height):new DOMRect(T.left,k.bottom,T.width,T.top-k.bottom)];for(const M of R){let O="width"in M?M:M.element.getBoundingClientRect();const D=NF()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(O.width<D){const F=D-O.width;O=new DOMRect(O.x-F/2,O.y,O.width+F,O.height)}if(O.height<D){const F=D-O.height;O=new DOMRect(O.x,O.y-F/2,O.width,O.height+F)}const j=S<=d||S>p;!u&&!j&&a.push({group:e,groupSize:Ra({group:e}),panels:[_,C],separator:"width"in M?void 0:M,rect:O}),u=!1}}h=!1,_=C,y=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?y.push(C):(_=void 0,y=[])}else h=!0}return a}var ro,OE;let yN=(OE=class{constructor(){Aw(this,ro,{})}addListener(t,n){const r=Ic(this,ro)[t];return r===void 0?Ic(this,ro)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Ic(this,ro)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,l=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const h=a[u];try{h.call(null,n)}catch(d){l===null&&(s=!0,l=d)}}if(s)throw l}}removeAllListeners(){Dw(this,ro,{})}removeListener(t,n){const r=Ic(this,ro)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},ro=new WeakMap,OE),Ci=new Map;const bN=new yN;function AF(e){Ci=new Map(Ci),Ci.delete(e)}function ok(e,t){for(const[n]of Ci)if(n.id===e)return n}function oo(e,t){for(const[n,r]of Ci)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function hl(){return Ci}function Qb(e,t){return bN.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function ps(e,t){const n=Ci.get(e);Ci=new Map(Ci),Ci.set(e,t),bN.emit("groupChange",{group:e,prev:n,next:t})}function DF(e,t,n){let r,s={x:1/0,y:1/0};for(const l of t){const a=vN(n,l.rect);switch(e){case"horizontal":{a.x<=s.x&&(r=l,s=a);break}case"vertical":{a.y<=s.y&&(r=l,s=a);break}}}return r?{distance:s,hitRegion:r}:void 0}function OF(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function LF(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:ck(e),b:ck(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();yt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:ak(lk(n.a)),b:ak(lk(n.b))};if(s.a===s.b){const l=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=l.length;for(;u--;){const h=l[u];if(h===a.a)return 1;if(h===a.b)return-1}}return Math.sign(s.a-s.b)}const jF=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function zF(e){const t=getComputedStyle(xN(e)??e).display;return t==="flex"||t==="inline-flex"}function PF(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||zF(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"||jF.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function lk(e){let t=e.length;for(;t--;){const n=e[t];if(yt(n,"Missing node"),PF(n))return n}return null}function ak(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ck(e){const t=[];for(;e;)t.push(e),e=xN(e);return t}function xN(e){const{parentNode:t}=e;return OF(t)?t.host:t}function BF(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 IF({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!gN(n)||n.contains(e)||e.contains(n))return!0;if(LF(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(BF(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Jb(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const l=_N(s),a=DF(s.orientation,l,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&IF({groupElement:s.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function HF(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 Wn(e,t,n=0){return Math.abs(or(e)-or(t))<=n}function bi(e,t){return Wn(e,t)?0:e>t?1:-1}function fa({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:l,disabled:a,maxSize:u=100,minSize:h=0}=t;if(a&&!e)return n;if(bi(r,h)<0)if(l){const d=(s+h)/2;bi(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=or(r),r}function Lu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:l}){if(Wn(e,0))return t;const a=l==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[p,m]=r;yt(p!=null,"Invalid first pivot index"),yt(m!=null,"Invalid second pivot index");let _=0;switch(l){case"keyboard":{{const w=e<0?m:p,C=n[w];yt(C,`Panel constraints not found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(yt(M!=null,`Previous layout not found for panel index ${w}`),Wn(M,k)){const O=R-M;bi(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}{const w=e<0?p:m,C=n[w];yt(C,`No panel constraints found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(yt(M!=null,`Previous layout not found for panel index ${w}`),Wn(M,R)){const O=M-k;bi(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}break}default:{const w=e<0?m:p,C=n[w];yt(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:M}=C;if(T&&bi(k,M)<0)if(e>0){const O=M-R,D=O/2,j=k+e;bi(j,M)<0&&(e=bi(e,D)<=0?0:O)}else{const O=M-R,D=100-O/2,j=k-e;bi(j,M)<0&&(e=bi(100+e,D)>0?0:-O)}break}}{const w=e<0?1:-1;let C=e<0?m:p,k=0;for(;;){const R=u[C];yt(R!=null,`Previous layout not found for panel index ${C}`);const M=fa({overrideDisabledPanels:a,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=M,C+=w,C<0||C>=n.length)break}const T=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-T:T}{let w=e<0?p:m;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[w];yt(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=fa({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:k,size:T});if(!Wn(k,R)&&(_+=k-R,d[w]=R,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(HF(h,d))return s;{const w=e<0?m:p,C=u[w];yt(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=fa({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:C,size:k});if(d[w]=T,!Wn(T,k)){let R=k-T,M=e<0?m:p;for(;M>=0&&M<n.length;){const O=d[M];yt(O!=null,`Previous layout not found for panel index ${M}`);const D=O+R,j=fa({overrideDisabledPanels:a,panelConstraints:n[M],prevSize:O,size:D});if(Wn(O,j)||(R-=j-O,d[M]=j),Wn(R,0))break;e>0?M--:M++}}}const y=Object.values(d).reduce((w,C)=>C+w,0);if(!Wn(y,100,.1))return s;const S=Object.keys(s);return d.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function tl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||bi(e[n],t[n])!==0)return!1;return!0}function nl({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(!Wn(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];yt(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let l=0;for(let u=0;u<t.length;u++){const h=n[u];yt(h!=null,`No layout data found for index ${u}`);const d=r[u];yt(d!=null,`No layout data found for index ${u}`);const p=fa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=p&&(l+=d-p,r[u]=p)}if(!Wn(l,0))for(let u=0;u<t.length;u++){const h=r[u];yt(h!=null,`No layout data found for index ${u}`);const d=h+l,p=fa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==p&&(l-=p-h,r[u]=p,Wn(l,0)))break}const a=Object.keys(e);return r.reduce((u,h,d)=>(u[a[d]]=h,u),{})}function SN({groupId:e,panelId:t}){const n=()=>{const u=hl();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:m,groupSize:_,separatorToPanels:y}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:h,groupSize:_,layout:m,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}`)},l=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=u=>{const h=l();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:m,groupSize:_,layout:y,separatorToPanels:S}=n(),w=m.panels.findIndex(R=>R.id===t),C=w===m.panels.length-1,k=Lu({delta:C?h-u:u-h,initialLayout:y,panelConstraints:p,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:y,trigger:"imperative-api"}),T=nl({layout:k,panelConstraints:p});tl(y,T)||ps(m,{defaultLayoutDeferred:d,derivedPanelConstraints:p,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),p=l();u&&p!==h&&(d.expandToSize=p,a(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:p}=s(),m=l();if(u&&m===h){let _=p.expandToSize??d;_===0&&(_=1),a(_)}},getSize:()=>{const{group:u}=n(),h=l(),{element:d}=s(),p=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:p}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=l();return u&&Wn(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),p=Ra({group:h}),m=su({groupSize:p,panelElement:d,styleProp:u}),_=or(m/p*100);a(_)}}}function uk(e){if(e.defaultPrevented)return;const t=hl();Jb(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,l=SN({groupId:n.group.id,panelId:r.id});l&&s!==void 0&&(l.resize(s),e.preventDefault())}}})}function sf(e){const t=hl();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 wN({groupId:e}){const t=()=>{const n=hl();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:l,groupSize:a,layout:u,separatorToPanels:h}=t(),d=nl({layout:n,panelConstraints:s});return r?u:(tl(u,d)||ps(l,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:a,layout:d,separatorToPanels:h}),d)}}}function Io(e,t){const n=sf(e),r=oo(n.id,!0),s=n.separators.find(p=>p.element===e);yt(s,"Matching separator not found");const l=r.separatorToPanels.get(s);yt(l,"Matching panels not found");const a=l.map(p=>n.panels.indexOf(p)),u=wN({groupId:n.id}).getLayout(),h=Lu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=nl({layout:h,panelConstraints:r.derivedPanelConstraints});tl(u,d)||ps(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function dk(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=sf(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Io(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Io(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Io(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Io(t,-5);break}case"End":{e.preventDefault(),Io(t,100);break}case"Enter":{e.preventDefault();const r=sf(t),s=oo(r.id,!0),{derivedPanelConstraints:l,layout:a,separatorToPanels:u}=s,h=r.separators.find(_=>_.element===t);yt(h,"Matching separator not found");const d=u.get(h);yt(d,"Matching panels not found");const p=d[0],m=l.find(_=>_.panelId===p.id);if(yt(m,"Panel metadata not found"),m.collapsible){const _=a[p.id],y=m.collapsedSize===_?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;Io(t,y-_)}break}case"F6":{e.preventDefault();const r=sf(t).separators.map(a=>a.element),s=Array.from(r).findIndex(a=>a===e.currentTarget);yt(s!==null,"Index not found");const l=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Io(t,-100);break}}}let ba={cursorFlags:0,state:"inactive"};const e0=new yN;function rl(){return ba}function FF(e){return e0.addListener("change",e)}function UF(e){const t=ba,n={...ba};n.cursorFlags=e,ba=n,e0.emit("change",{prev:t,next:n})}function xa(e){const t=ba;ba=e,e0.emit("change",{prev:t,next:e})}function hk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=hl(),n=Jb(e,t),r=new Map;let s=!1;n.forEach(l=>{l.separator&&(s||(s=!0,l.separator.element.focus({preventScroll:!0})));const a=t.get(l.group);a&&r.set(l.group,a.layout)}),xa({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const $F=e=>e,kv=()=>{},CN=1,kN=2,EN=4,RN=8,fk=3,pk=12;let zh;function mk(){return zh===void 0&&(zh=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(zh=!0)),zh}function WF({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(l=>{if(!l.mutableState.disableCursor)switch(l.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&mk()){const l=(e&CN)!==0,a=(e&kN)!==0,u=(e&EN)!==0,h=(e&RN)!==0;if(l)return u?"se-resize":h?"ne-resize":"e-resize";if(a)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return mk()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const gk=new WeakMap;function t0(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=gk.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=rl();switch(r.state){case"active":case"hover":{const s=WF({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),l=`*, *:hover {cursor: ${s} !important; }`;if(t===l)return;t=l,s?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}gk.set(e,{prevStyle:t,styleSheet:n})}function TN({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:l,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:p,groupSize:m}=d,{orientation:_,panels:y}=p,{disableCursor:S}=p.mutableState;let w=0;l?_==="horizontal"?w=(t.clientX-l.x)/m*100:w=(t.clientY-l.y)/m*100:_==="horizontal"?w=t.clientX<0?-100:100:w=t.clientY<0?-100:100;const C=r.get(p),k=s.get(p);if(!C||!k)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:O,separatorToPanels:D}=k;if(R&&O&&D){const j=Lu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:d.panels.map(F=>y.indexOf(F)),prevLayout:O,trigger:"mouse-or-touch"});if(tl(j,O)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?CN:kN;break}case"vertical":{u|=w<0?EN:RN;break}}}else ps(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:j,separatorToPanels:D})}});let h=0;t.movementX===0?h|=a&fk:h|=u&fk,t.movementY===0?h|=a&pk:h|=u&pk,UF(h),t0(e)}function vk(e){const t=hl(),n=rl();switch(n.state){case"active":TN({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function _k(e){if(e.defaultPrevented)return;const t=rl(),n=hl();switch(t.state){case"active":{if(e.buttons===0){xa({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=oo(r.group.id,!0);ps(r.group,s)});return}TN({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Jb(e,n);r.length===0?t.state!=="inactive"&&xa({cursorFlags:0,state:"inactive"}):xa({cursorFlags:0,hitRegions:r,state:"hover"}),t0(e.currentTarget);break}}}function yk(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(rl().state){case"hover":xa({cursorFlags:0,state:"inactive"})}}function bk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=rl();switch(t.state){case"active":xa({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(t0(e.currentTarget),t.hitRegions.forEach(n=>{const r=oo(n.group.id,!0);ps(n.group,r)}),e.preventDefault())}}function xk(e){let t=0,n=0;const r={};for(const l of e)if(l.defaultSize!==void 0){t++;const a=or(l.defaultSize);n+=a,r[l.panelId]=a}else r[l.panelId]=void 0;const s=e.length-t;if(s!==0){const l=or((100-n)/s);for(const a of e)a.defaultSize===void 0&&(r[a.panelId]=l)}return r}function VF(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=Ra({group:e}),l=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:or(l/s*100),inPixels:l};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function qF(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 KF({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,l=0,a=!1;const u=new Map,h=[];for(const m of e.panels){const _=r[m.id]??0;switch(m.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{a=!0;const y=_/100*n,S=or(y/t*100);u.set(m.id,S),s+=S;break}case"preserve-relative-size":default:{h.push(m.id),l+=_;break}}}if(!a||h.length===0)return r;const d=100-s,p={...r};if(u.forEach((m,_)=>{p[_]=m}),l>0)for(const m of h){const _=r[m]??0;p[m]=or(_/l*d)}else{const m=or(d/h.length);for(const _ of h)p[_]=m}return p}function GF(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 ia=new Map;function YF(e){let t=!0;yt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,l=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=Ra({group:e});if(T===0)return;const R=oo(e.id);if(!R)return;const M=B_(e),O=R.defaultLayoutDeferred?xk(M):R.layout,D=KF({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:O}),j=nl({layout:D,panelConstraints:M});if(!R.defaultLayoutDeferred&&tl(R.layout,j)&&qF(R.derivedPanelConstraints,M)&&R.groupSize===T)return;ps(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:j,separatorToPanels:R.separatorToPanels})}}else VF(e,k,C)}});l.observe(e.element),e.panels.forEach(S=>{yt(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&l.observe(S.element)});const a=Ra({group:e}),u=B_(e),h=e.panels.map(({id:S})=>S).join(",");let d=e.mutableState.defaultLayout;d&&(GF(e.panels,d)||(d=void 0));const p=e.mutableState.layouts[h]??d??xk(u),m=nl({layout:p,panelConstraints:u}),_=e.element.ownerDocument;ia.set(_,(ia.get(_)??0)+1);const y=new Map;return _N(e).forEach(S=>{S.separator&&y.set(S.separator,S.panels)}),ps(e,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:m,separatorToPanels:y}),e.separators.forEach(S=>{yt(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",dk)}),ia.get(_)===1&&(_.addEventListener("dblclick",uk,!0),_.addEventListener("pointerdown",hk,!0),_.addEventListener("pointerleave",vk),_.addEventListener("pointermove",_k),_.addEventListener("pointerout",yk),_.addEventListener("pointerup",bk,!0)),function(){t=!1,ia.set(_,Math.max(0,(ia.get(_)??0)-1)),AF(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",dk)}),ia.get(_)||(_.removeEventListener("dblclick",uk,!0),_.removeEventListener("pointerdown",hk,!0),_.removeEventListener("pointerleave",vk),_.removeEventListener("pointermove",_k),_.removeEventListener("pointerout",yk),_.removeEventListener("pointerup",bk,!0)),l.disconnect()}}function XF(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function n0(e){const t=b.useId();return`${e??t}`}const fl=typeof window<"u"?b.useLayoutEffect:b.useEffect;function yu(e){const t=b.useRef(e);return fl(()=>{t.current=e},[e]),b.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function r0(...e){return yu(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function i0(e){const t=b.useRef({...e});return fl(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const MN=b.createContext(null);function ZF(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:$F});b.useImperativeHandle(t,()=>n.current,[]),fl(()=>{Object.assign(n.current,wN({groupId:e}))})}function NN({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:l,groupRef:a,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:_,...y}){const S=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=yu(W=>{tl(S.current.onLayoutChange,W)||(S.current.onLayoutChange=W,h==null||h(W))}),C=yu(W=>{tl(S.current.onLayoutChanged,W)||(S.current.onLayoutChanged=W,d==null||d(W))}),k=n0(u),T=b.useRef(null),[R,M]=XF(),O=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),D=r0(T,l);ZF(k,a);const j=yu((W,I)=>{const $=rl(),U=ok(W),H=oo(W);if(H){let B=!1;switch($.state){case"active":{B=$.hitRegions.some(q=>q.group===U);break}}return{flexGrow:H.layout[I]??1,pointerEvents:B?"none":void 0}}return{flexGrow:(n==null?void 0:n[I])??1}}),F=i0({defaultLayout:n,disableCursor:r}),G=b.useMemo(()=>({get disableCursor(){return!!F.disableCursor},getPanelStyles:j,id:k,orientation:p,registerPanel:W=>{const I=O.current;return I.panels=I_(p,[...I.panels,W]),M(),()=>{I.panels=I.panels.filter($=>$!==W),M()}},registerSeparator:W=>{const I=O.current;return I.separators=I_(p,[...I.separators,W]),M(),()=>{I.separators=I.separators.filter($=>$!==W),M()}},togglePanelDisabled:(W,I)=>{const $=O.current.panels.find(B=>B.id===W);$&&($.panelConstraints.disabled=I);const U=ok(k),H=oo(k);U&&H&&ps(U,{...H,derivedPanelConstraints:B_(U)})},toggleSeparatorDisabled:(W,I)=>{const $=O.current.separators.find(U=>U.id===W);$&&($.disabled=I)}}),[j,k,M,p,F]),P=b.useRef(null);return fl(()=>{const W=T.current;if(W===null)return;const I=O.current;let $;if(F.defaultLayout!==void 0&&Object.keys(F.defaultLayout).length===I.panels.length){$={};for(const N of I.panels){const z=F.defaultLayout[N.id];z!==void 0&&($[N.id]=z)}}const U={disabled:!!s,element:W,id:k,mutableState:{defaultLayout:$,disableCursor:!!F.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:p,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};P.current=U;const H=YF(U),{defaultLayoutDeferred:B,derivedPanelConstraints:q,layout:V}=oo(U.id,!0);!B&&q.length>0&&(w(V),C(V));const Z=Qb(k,N=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:Y,layout:A}=N.next;if(z||Y.length===0)return;const oe=U.panels.map(({id:se})=>se).join(",");U.mutableState.layouts[oe]=A,Y.forEach(se=>{if(se.collapsible){const{layout:J}=N.prev??{};if(J){const ge=Wn(se.collapsedSize,A[se.panelId]),ie=Wn(se.collapsedSize,J[se.panelId]);ge&&!ie&&(U.mutableState.expandedPanelSizes[se.panelId]=J[se.panelId])}}});const fe=rl().state!=="active";w(A),fe&&C(A)});return()=>{P.current=null,H(),Z()}},[s,k,C,w,p,R,F]),b.useEffect(()=>{const W=P.current;W&&(W.mutableState.defaultLayout=n,W.mutableState.disableCursor=!!r)}),g.jsx(MN.Provider,{value:G,children:g.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:D,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}NN.displayName="Group";function s0(){const e=b.useContext(MN);return yt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function QF(e,t){const{id:n}=s0(),r=b.useRef({collapse:kv,expand:kv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:kv});b.useImperativeHandle(t,()=>r.current,[]),fl(()=>{Object.assign(r.current,SN({groupId:n,panelId:e}))})}function AN({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:l,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:p="0%",onResize:m,panelRef:_,style:y,...S}){const w=!!h,C=n0(h),k=i0({disabled:l}),T=b.useRef(null),R=r0(T,a),{getPanelStyles:M,id:O,orientation:D,registerPanel:j,togglePanelDisabled:F}=s0(),G=m!==null,P=yu((I,$,U)=>{m==null||m(I,h,U)});fl(()=>{const I=T.current;if(I!==null){const $={element:I,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?P:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:p}};return j($)}},[u,n,r,s,G,C,w,d,p,P,j,k]),b.useEffect(()=>{F(C,!!l)},[l,C,F]),QF(C,_);const W=b.useSyncExternalStore(I=>Qb(O,I),()=>JSON.stringify(M(O,C)),()=>JSON.stringify(M(O,C)));return g.jsx("div",{...S,"aria-disabled":l||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...JF,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(W)},children:g.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:e})})}AN.displayName="Panel";const JF={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function eU({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,l;const a=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,p=[r,r+1];l=nl({layout:Lu({delta:d-a,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],s=nl({layout:Lu({delta:h-a,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:l,valueNow:a}}function DN({children:e,className:t,disabled:n,elementRef:r,id:s,style:l,...a}){const u=n0(s),h=i0({disabled:n}),[d,p]=b.useState({}),[m,_]=b.useState("inactive"),y=b.useRef(null),S=r0(y,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=s0(),M=k==="horizontal"?"vertical":"horizontal";fl(()=>{const D=y.current;if(D!==null){const j={disabled:h.disabled,element:D,id:u},F=T(j),G=FF(W=>{_(W.next.state!=="inactive"&&W.next.hitRegions.some(I=>I.separator===j)?W.next.state:"inactive")}),P=Qb(C,W=>{const{derivedPanelConstraints:I,layout:$,separatorToPanels:U}=W.next,H=U.get(j);if(H){const B=H[0],q=H.indexOf(B);p(eU({layout:$,panelConstraints:I,panelId:B.id,panelIndex:q}))}});return()=>{G(),P(),F()}}},[C,u,T,h]),b.useEffect(()=>{R(u,!!n)},[n,u,R]);let O;return n&&!w&&(O="not-allowed"),g.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":m,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:O,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}DN.displayName="Separator";const of=({className:e,...t})=>g.jsx(NN,{className:ye("flex h-full w-full",e),...t}),Wo=e=>g.jsx(AN,{...e}),lf=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>g.jsx(DN,{disabled:n,className:ye("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:g.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
454
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
455
|
+
* @license MIT
|
|
456
|
+
*
|
|
457
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
458
|
+
* @license MIT
|
|
459
|
+
*
|
|
460
|
+
* Originally forked from (with the author's permission):
|
|
461
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
462
|
+
* http://bellard.org/jslinux/
|
|
463
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
464
|
+
*/var vn=0,_n=0,yn=0,Ut=0,jn;(e=>{function t(s,l,a,u){return u!==void 0?`#${Ho(s)}${Ho(l)}${Ho(a)}${Ho(u)}`:`#${Ho(s)}${Ho(l)}${Ho(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})(jn||(jn={}));var tU;(e=>{function t(h,d){if(Ut=(d.rgba&255)/255,Ut===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,m=d.rgba>>16&255,_=d.rgba>>8&255,y=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;vn=y+Math.round((p-y)*Ut),_n=S+Math.round((m-S)*Ut),yn=w+Math.round((_-w)*Ut);let C=jn.toCss(vn,_n,yn),k=jn.toRgba(vn,_n,yn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,p){let m=af.ensureContrastRatio(h.rgba,d.rgba,p);if(m)return jn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[vn,_n,yn]=af.toChannels(d),{css:jn.toCss(vn,_n,yn),rgba:d}}e.opaque=s;function l(h,d){return Ut=Math.round(d*255),[vn,_n,yn]=af.toChannels(h.rgba),{css:jn.toCss(vn,_n,yn,Ut),rgba:jn.toRgba(vn,_n,yn,Ut)}}e.opacity=l;function a(h,d){return Ut=h.rgba&255,l(h,Ut*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(tU||(tU={}));var Mn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,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 vn=parseInt(s.slice(1,2).repeat(2),16),_n=parseInt(s.slice(2,3).repeat(2),16),yn=parseInt(s.slice(3,4).repeat(2),16),jn.toColor(vn,_n,yn);case 5:return vn=parseInt(s.slice(1,2).repeat(2),16),_n=parseInt(s.slice(2,3).repeat(2),16),yn=parseInt(s.slice(3,4).repeat(2),16),Ut=parseInt(s.slice(4,5).repeat(2),16),jn.toColor(vn,_n,yn,Ut);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 l=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(l)return vn=parseInt(l[1]),_n=parseInt(l[2]),yn=parseInt(l[3]),Ut=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),jn.toColor(vn,_n,yn,Ut);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),[vn,_n,yn,Ut]=t.getImageData(0,0,1,1).data,Ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:jn.toRgba(vn,_n,yn,Ut),css:s}}e.toColor=r})(Mn||(Mn={}));var Fn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Fn||(Fn={}));var af;(e=>{function t(a,u){if(Ut=(u&255)/255,Ut===1)return u;let h=u>>24&255,d=u>>16&255,p=u>>8&255,m=a>>24&255,_=a>>16&255,y=a>>8&255;return vn=m+Math.round((h-m)*Ut),_n=_+Math.round((d-_)*Ut),yn=y+Math.round((p-y)*Ut),jn.toRgba(vn,_n,yn)}e.blend=t;function n(a,u,h){let d=Fn.relativeLuminance(a>>8),p=Fn.relativeLuminance(u>>8);if(rs(d,p)<h){if(p<d){let y=r(a,u,h),S=rs(d,Fn.relativeLuminance(y>>8));if(S<h){let w=s(a,u,h),C=rs(d,Fn.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(a,u,h),_=rs(d,Fn.relativeLuminance(m>>8));if(_<h){let y=r(a,u,h),S=rs(d,Fn.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));for(;w<h&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));for(;w<h&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(af||(af={}));function Ho(e){let t=e.toString(16);return t.length<2?"0"+t:t}function rs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var nU=Object.freeze((()=>{let e=[Mn.toColor("#2e3436"),Mn.toColor("#cc0000"),Mn.toColor("#4e9a06"),Mn.toColor("#c4a000"),Mn.toColor("#3465a4"),Mn.toColor("#75507b"),Mn.toColor("#06989a"),Mn.toColor("#d3d7cf"),Mn.toColor("#555753"),Mn.toColor("#ef2929"),Mn.toColor("#8ae234"),Mn.toColor("#fce94f"),Mn.toColor("#729fcf"),Mn.toColor("#ad7fa8"),Mn.toColor("#34e2e2"),Mn.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],l=t[n%6];e.push({css:jn.toCss(r,s,l),rgba:jn.toRgba(r,s,l)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:jn.toCss(r,r,r),rgba:jn.toRgba(r,r,r)})}return e})());function Sk(e,t,n){return Math.max(t,Math.min(e,n))}function rU(e){switch(e){case"&":return"&";case"<":return"<"}return e}var ON=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),l=r,a=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-a,a,u);for(let p=a;p<=u;p++){let m=this._buffer.getLine(p);if(m){let _=p===t.start.y?h:0,y=p===t.end.y?d:m.length;for(let S=_;S<y;S++){let w=m.getCell(S,l===r?s:r);if(!w){console.warn(`Can't get cell at row=${p}, col=${S}`);continue}this._nextCell(w,l,p,S),l=w}}this._rowEnd(p,p===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function LN(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function os(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function jN(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 iU=class extends ON{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&&!os(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 l=this._buffer.getLine(t),a=this._buffer.getLine(t+1);if(!a.isWrapped)r=`\r
|
|
465
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=l.getCell(l.length-1,this._thisRowLastChar),h=l.getCell(l.length-2,this._thisRowLastSecondChar),d=a.getCell(0,this._nextRowFirstChar),p=d.getWidth()>1,m=!1;(d.getChars()&&p?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&os(u,d)&&(m=!0),p&&(h.getChars()||h.getWidth()===0)&&os(u,d)&&os(h,d)&&(m=!0)),m||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${l.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${l.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=!LN(t,n),l=!os(t,n),a=!jN(t,n);if(s||l||a)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(l){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)}a&&(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 l=t.getChars()==="",a=this._diffStyle(t,this._cursorStyle);if(l?!os(this._cursorStyle,t):a.length>0){this._nullCellCount>0&&(os(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[${a.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}l?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(os(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 a=0;a<n;a++)r+=this._allRows[a],a+1<n&&(r+=this._allRowSeparators[a]);if(!t){let a=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,h=a!==this._lastCursorRow||u!==this._lastCursorCol,d=p=>{p>0?r+=`\x1B[${p}C`:p<0&&(r+=`\x1B[${-p}D`)};h&&((p=>{p>0?r+=`\x1B[${p}B`:p<0&&(r+=`\x1B[${-p}A`)})(a-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,l=this._diffStyle(s,this._cursorStyle);return l.length>0&&(r+=`\x1B[${l.join(";")}m`),r}},sU=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,l=r===void 0?s:Sk(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-l,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new iU(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 oU(r,t,n),l=n.onlySelection??!1,a=n.range;if(a)return s.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:t.cols,y:(a.endLine,a.endLine)}});if(!l){let d=r.length,p=n.scrollback,m=p===void 0?d:Sk(p+t.rows,0,d);return s.serialize({start:{x:0,y:d-m},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(){}},oU=class extends ON{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=nU}_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",l="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",l=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let a=[];a.push("color: "+s+";"),a.push("background-color: "+l+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.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=!LN(t,n),l=!os(t,n),a=!jN(t,n);if(s||l||a){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 l=t.getChars()==="",a=this._diffStyle(t,n);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),l?this._currentRow+=" ":this._currentRow+=rU(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
466
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
467
|
+
* @license MIT
|
|
468
|
+
*
|
|
469
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
470
|
+
* @license MIT
|
|
471
|
+
*
|
|
472
|
+
* Originally forked from (with the author's permission):
|
|
473
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
474
|
+
* http://bellard.org/jslinux/
|
|
475
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
476
|
+
*/var lU=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=cU.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:l}=n;this._options.hover(r,s,l)}},n))}};function aU(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 cU=class cf{static computeLink(t,n,r,s){let l=new RegExp(n.source,(n.flags||"")+"g"),[a,u]=cf._getWindowedLineStrings(t-1,r),h=a.join(""),d,p=[];for(;d=l.exec(h);){let m=d[0];if(!aU(m))continue;let[_,y]=cf._mapStrIdx(r,u,0,d.index),[S,w]=cf._mapStrIdx(r,_,y,m.length);if(_===-1||y===-1||S===-1||w===-1)continue;let C={start:{x:y+1,y:_+1},end:{x:w,y:S+1}};p.push({range:C,text:m,activate:s})}return p}static _getWindowedLineStrings(t,n){let r,s=t,l=t,a=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(a=0;(r=n.buffer.active.getLine(--s))&&a<2048&&(u=r.translateToString(!0),a+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),a=0;(r=n.buffer.active.getLine(++l))&&r.isWrapped&&a<2048&&(u=r.translateToString(!0),a+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let l=t.buffer.active,a=l.getNullCell(),u=r;for(;s;){let h=l.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,a);let p=a.getChars();if(a.getWidth()&&(s-=p.length||1,d===h.length-1&&p==="")){let m=l.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,a),a.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},uU=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function dU(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 hU=class{constructor(t=dU,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||uU;this._linkProvider=this._terminal.registerLinkProvider(new lU(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
477
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
478
|
+
* @license MIT
|
|
479
|
+
*
|
|
480
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
481
|
+
* @license MIT
|
|
482
|
+
*
|
|
483
|
+
* Originally forked from (with the author's permission):
|
|
484
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
485
|
+
* http://bellard.org/jslinux/
|
|
486
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
487
|
+
*/var zN=Object.defineProperty,fU=Object.getOwnPropertyDescriptor,pU=(e,t)=>{for(var n in t)zN(e,n,{get:t[n],enumerable:!0})},Wt=(e,t,n,r)=>{for(var s=r>1?void 0:r?fU(t,n):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&zN(t,n,s),s},Ee=(e,t)=>(n,r)=>t(n,r,e),wk="Terminal input",H_={get:()=>wk,set:e=>wk=e},Ck="Too much output to announce, navigate to rows manually to read",F_={get:()=>Ck,set:e=>Ck=e};function mU(e){return e.replace(/\r?\n/g,"\r")}function gU(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function vU(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function _U(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");PN(s,t,n,r)}}function PN(e,t,n,r){e=mU(e),e=gU(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function BN(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function kk(e,t,n,r,s){BN(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function to(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ep(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let l=e[s];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var yU=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 l=e.charCodeAt(s++);56320<=l&&l<=57343?t[r++]=(this._interim-55296)*1024+l-56320+65536:(t[r++]=this._interim,t[r++]=l),this._interim=0}for(let l=s;l<n;++l){let a=e.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=n)return this._interim=a,r;let u=e.charCodeAt(l);56320<=u&&u<=57343?t[r++]=(a-55296)*1024+u-56320+65536:(t[r++]=a,t[r++]=u);continue}a!==65279&&(t[r++]=a)}return r}},bU=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,l,a,u,h=0,d=0;if(this.interim[0]){let _=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)y<<=6,y|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;d<k;){if(d>=n)return 0;if(w=e[d++],(w&192)!==128){d--,_=!0;break}else this.interim[S++]=w,y<<=6,y|=w&63}_||(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 p=n-4,m=d;for(;m<n;){for(;m<p&&!((s=e[m])&128)&&!((l=e[m+1])&128)&&!((a=e[m+2])&128)&&!((u=e[m+3])&128);)t[r++]=s,t[r++]=l,t[r++]=a,t[r++]=u,m+=4;if(s=e[m++],s<128)t[r++]=s;else if((s&224)===192){if(m>=n)return this.interim[0]=s,r;if(l=e[m++],(l&192)!==128){m--;continue}if(h=(s&31)<<6|l&63,h<128){m--;continue}t[r++]=h}else if((s&240)===224){if(m>=n)return this.interim[0]=s,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[m++],(a&192)!==128){m--;continue}if(h=(s&15)<<12|(l&63)<<6|a&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(m>=n)return this.interim[0]=s,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,this.interim[2]=a,r;if(u=e[m++],(u&192)!==128){m--;continue}if(h=(s&7)<<18|(l&63)<<12|(a&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},IN="",so=" ",ed=class HN{constructor(){this.fg=0,this.bg=0,this.extended=new Bf}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 HN;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}},Bf=class FN{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 FN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Vr=class UN extends ed{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Bf,this.combinedData=""}static fromCharData(t){let n=new UN;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?to(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()]}},Ek="di$target",U_="di$dependencies",Ev=new Map;function xU(e){return e[U_]||[]}function wn(e){if(Ev.has(e))return Ev.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");SU(t,n,s)};return t._id=e,Ev.set(e,t),t}function SU(e,t,n){t[Ek]===t?t[U_].push({id:e,index:n}):(t[U_]=[{id:e,index:n}],t[Ek]=t)}var Kn=wn("BufferService"),$N=wn("CoreMouseService"),pl=wn("CoreService"),wU=wn("CharsetService"),o0=wn("InstantiationService"),WN=wn("LogService"),Gn=wn("OptionsService"),VN=wn("OscLinkService"),CU=wn("UnicodeService"),td=wn("DecorationService"),$_=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,l=new Vr,a=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let m=0;m<a;m++)if(!(h===-1&&!n.hasContent(m))){if(n.loadCell(m,l),l.hasExtendedAttrs()&&l.extended.urlId)if(h===-1){h=m,u=l.extended.urlId;continue}else d=l.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&m===a-1){let _=(p=this._oscLinkService.getLinkData(u))==null?void 0:p.uri;if(_){let y={start:{x:h+1,y:e},end:{x:m+(!d&&m===a-1?1:0),y:e}},S=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let w=new URL(_);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:_,range:y,activate:(w,C)=>s?s.activate(w,C,y):kU(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,y)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,y)}})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=m,u=l.extended.urlId):(h=-1,u=-1)}}t(r)}};$_=Wt([Ee(0,Kn),Ee(1,Gn),Ee(2,VN)],$_);function kU(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
488
|
+
|
|
489
|
+
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 Rp=wn("CharSizeService"),vs=wn("CoreBrowserService"),l0=wn("MouseService"),_s=wn("RenderService"),EU=wn("SelectionService"),qN=wn("CharacterJoinerService"),Wa=wn("ThemeService"),KN=wn("LinkProviderService"),RU=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Rk.isErrorNoTelemetry(e)?new Rk(e.message+`
|
|
490
|
+
|
|
491
|
+
`+e.stack):new Error(e.message+`
|
|
492
|
+
|
|
493
|
+
`+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)}},TU=new RU;function uf(e){MU(e)||TU.onUnexpectedError(e)}var W_="Canceled";function MU(e){return e instanceof NU?!0:e instanceof Error&&e.name===W_&&e.message===W_}var NU=class extends Error{constructor(){super(W_),this.name=this.message}};function AU(e){return new Error(`Illegal argument: ${e}`)}var Rk=class V_ extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof V_)return t;let n=new V_;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},q_=class GN extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,GN.prototype)}};function yr(e,t=0){return e[e.length-(1+t)]}var DU;(e=>{function t(l){return l<0}e.isLessThan=t;function n(l){return l<=0}e.isLessThanOrEqual=n;function r(l){return l>0}e.isGreaterThan=r;function s(l){return l===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(DU||(DU={}));function OU(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var YN;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(M){yield M}e.single=s;function l(M){return t(M)?M:s(M)}e.wrap=l;function a(M){return M||n}e.from=a;function*u(M){for(let O=M.length-1;O>=0;O--)yield M[O]}e.reverse=u;function h(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(M){return M[Symbol.iterator]().next().value}e.first=d;function p(M,O){let D=0;for(let j of M)if(O(j,D++))return!0;return!1}e.some=p;function m(M,O){for(let D of M)if(O(D))return D}e.find=m;function*_(M,O){for(let D of M)O(D)&&(yield D)}e.filter=_;function*y(M,O){let D=0;for(let j of M)yield O(j,D++)}e.map=y;function*S(M,O){let D=0;for(let j of M)yield*O(j,D++)}e.flatMap=S;function*w(...M){for(let O of M)yield*O}e.concat=w;function C(M,O,D){let j=D;for(let F of M)j=O(j,F);return j}e.reduce=C;function*k(M,O,D=M.length){for(O<0&&(O+=M.length),D<0?D+=M.length:D>M.length&&(D=M.length);O<D;O++)yield M[O]}e.slice=k;function T(M,O=Number.POSITIVE_INFINITY){let D=[];if(O===0)return[D,M];let j=M[Symbol.iterator]();for(let F=0;F<O;F++){let G=j.next();if(G.done)return[D,e.empty()];D.push(G.value)}return[D,{[Symbol.iterator](){return j}}]}e.consume=T;async function R(M){let O=[];for await(let D of M)O.push(D);return Promise.resolve(O)}e.asyncToArray=R})(YN||(YN={}));function il(e){if(YN.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 LU(...e){return jt(()=>il(e))}function jt(e){return{dispose:OU(()=>{e()})}}var XN=class ZN{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{il(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?ZN.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)}};XN.DISABLE_DISPOSED_WARNING=!1;var lo=XN,Ge=class{constructor(){this._store=new lo,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)}};Ge.None=Object.freeze({dispose(){}});var Ta=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}},as=typeof window=="object"?window:globalThis,K_=class G_{constructor(t){this.element=t,this.next=G_.Undefined,this.prev=G_.Undefined}};K_.Undefined=new K_(void 0);var Bt=K_,Tk=class{constructor(){this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Bt.Undefined}clear(){let e=this._first;for(;e!==Bt.Undefined;){let t=e.next;e.prev=Bt.Undefined,e.next=Bt.Undefined,e=t}this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Bt(e);if(this._first===Bt.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!==Bt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Bt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Bt.Undefined&&e.next!==Bt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Bt.Undefined&&e.next===Bt.Undefined?(this._first=Bt.Undefined,this._last=Bt.Undefined):e.next===Bt.Undefined?(this._last=this._last.prev,this._last.next=Bt.Undefined):e.prev===Bt.Undefined&&(this._first=this._first.next,this._first.prev=Bt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Bt.Undefined;)yield e.element,e=e.next}},jU=globalThis.performance&&typeof globalThis.performance.now=="function",zU=class QN{static create(t){return new QN(t)}constructor(t){this._now=jU&&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}},An;(e=>{e.None=()=>Ge.None;function t(I,$){return m(I,()=>{},0,void 0,!0,void 0,$)}e.defer=t;function n(I){return($,U=null,H)=>{let B=!1,q;return q=I(V=>{if(!B)return q?q.dispose():B=!0,$.call(U,V)},null,H),B&&q.dispose(),q}}e.once=n;function r(I,$,U){return d((H,B=null,q)=>I(V=>H.call(B,$(V)),null,q),U)}e.map=r;function s(I,$,U){return d((H,B=null,q)=>I(V=>{$(V),H.call(B,V)},null,q),U)}e.forEach=s;function l(I,$,U){return d((H,B=null,q)=>I(V=>$(V)&&H.call(B,V),null,q),U)}e.filter=l;function a(I){return I}e.signal=a;function u(...I){return($,U=null,H)=>{let B=LU(...I.map(q=>q(V=>$.call(U,V))));return p(B,H)}}e.any=u;function h(I,$,U,H){let B=U;return r(I,q=>(B=$(B,q),B),H)}e.reduce=h;function d(I,$){let U,H={onWillAddFirstListener(){U=I(B.fire,B)},onDidRemoveLastListener(){U==null||U.dispose()}},B=new xe(H);return $==null||$.add(B),B.event}function p(I,$){return $ instanceof Array?$.push(I):$&&$.add(I),I}function m(I,$,U=100,H=!1,B=!1,q,V){let Z,N,z,Y=0,A,oe={leakWarningThreshold:q,onWillAddFirstListener(){Z=I(se=>{Y++,N=$(N,se),H&&!z&&(fe.fire(N),N=void 0),A=()=>{let J=N;N=void 0,z=void 0,(!H||Y>1)&&fe.fire(J),Y=0},typeof U=="number"?(clearTimeout(z),z=setTimeout(A,U)):z===void 0&&(z=0,queueMicrotask(A))})},onWillRemoveListener(){B&&Y>0&&(A==null||A())},onDidRemoveLastListener(){A=void 0,Z.dispose()}},fe=new xe(oe);return V==null||V.add(fe),fe.event}e.debounce=m;function _(I,$=0,U){return e.debounce(I,(H,B)=>H?(H.push(B),H):[B],$,void 0,!0,void 0,U)}e.accumulate=_;function y(I,$=(H,B)=>H===B,U){let H=!0,B;return l(I,q=>{let V=H||!$(q,B);return H=!1,B=q,V},U)}e.latch=y;function S(I,$,U){return[e.filter(I,$,U),e.filter(I,H=>!$(H),U)]}e.split=S;function w(I,$=!1,U=[],H){let B=U.slice(),q=I(N=>{B?B.push(N):Z.fire(N)});H&&H.add(q);let V=()=>{B==null||B.forEach(N=>Z.fire(N)),B=null},Z=new xe({onWillAddFirstListener(){q||(q=I(N=>Z.fire(N)),H&&H.add(q))},onDidAddFirstListener(){B&&($?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return H&&H.add(Z),Z.event}e.buffer=w;function C(I,$){return(U,H,B)=>{let q=$(new T);return I(function(V){let Z=q.evaluate(V);Z!==k&&U.call(H,Z)},void 0,B)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map($){return this.steps.push($),this}forEach($){return this.steps.push(U=>($(U),U)),this}filter($){return this.steps.push(U=>$(U)?U:k),this}reduce($,U){let H=U;return this.steps.push(B=>(H=$(H,B),H)),this}latch($=(U,H)=>U===H){let U=!0,H;return this.steps.push(B=>{let q=U||!$(B,H);return U=!1,H=B,q?B:k}),this}evaluate($){for(let U of this.steps)if($=U($),$===k)break;return $}}function R(I,$,U=H=>H){let H=(...Z)=>V.fire(U(...Z)),B=()=>I.on($,H),q=()=>I.removeListener($,H),V=new xe({onWillAddFirstListener:B,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=R;function M(I,$,U=H=>H){let H=(...Z)=>V.fire(U(...Z)),B=()=>I.addEventListener($,H),q=()=>I.removeEventListener($,H),V=new xe({onWillAddFirstListener:B,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=M;function O(I){return new Promise($=>n(I)($))}e.toPromise=O;function D(I){let $=new xe;return I.then(U=>{$.fire(U)},()=>{$.fire(void 0)}).finally(()=>{$.dispose()}),$.event}e.fromPromise=D;function j(I,$){return I(U=>$.fire(U))}e.forward=j;function F(I,$,U){return $(U),I(H=>$(H))}e.runAndSubscribe=F;class G{constructor($,U){this._observable=$,this._counter=0,this._hasChanged=!1;let H={onWillAddFirstListener:()=>{$.addObserver(this)},onDidRemoveLastListener:()=>{$.removeObserver(this)}};this.emitter=new xe(H),U&&U.add(this.emitter)}beginUpdate($){this._counter++}handlePossibleChange($){}handleChange($,U){this._hasChanged=!0}endUpdate($){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(I,$){return new G(I,$).emitter.event}e.fromObservable=P;function W(I){return($,U,H)=>{let B=0,q=!1,V={beginUpdate(){B++},endUpdate(){B--,B===0&&(I.reportChanges(),q&&(q=!1,$.call(U)))},handlePossibleChange(){},handleChange(){q=!0}};I.addObserver(V),I.reportChanges();let Z={dispose(){I.removeObserver(V)}};return H instanceof lo?H.add(Z):Array.isArray(H)&&H.push(Z),Z}}e.fromObservableLight=W})(An||(An={}));var Y_=class X_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${X_._idPool++}`,X_.all.add(this)}start(t){this._stopWatch=new zU,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}}};Y_.all=new Set,Y_._idPool=0;var PU=Y_,BU=-1,JN=class eA{constructor(t,n,r=(eA._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[l,a]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${a}):`;console.warn(u),console.warn(l);let h=new FU(u,l);this._errorHandler(h)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-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}};JN._idPool=1;var IU=JN,HU=class tA{constructor(t){this.value=t}static create(){let t=new Error;return new tA(t.stack??"")}print(){console.warn(this.value.split(`
|
|
494
|
+
`).slice(2).join(`
|
|
495
|
+
`))}},FU=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},UU=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},$U=0,Rv=class{constructor(e){this.value=e,this.id=$U++}},WU=2,VU,xe=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new IU((e==null?void 0:e.onListenerError)??uf,((n=this._options)==null?void 0:n.leakWarningThreshold)??BU):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new PU(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 a,u,h,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new UU(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((a=this._options)==null?void 0:a.onListenerError)||uf)(y),Ge.None}if(this._disposed)return Ge.None;t&&(e=e.bind(t));let r=new Rv(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=HU.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Rv?(this._deliveryQueue??(this._deliveryQueue=new qU),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,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let l=jt(()=>{s==null||s(),this._removeListener(r)});return n instanceof lo?n.add(l):Array.isArray(n)&&n.push(l),l}),this._event}_removeListener(e){var s,l,a,u;if((l=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||l.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||u.call(a,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*WU<=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)||uf;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 Rv)this._deliver(this._listeners,e);else{let l=this._deliveryQueue;l.enqueue(this,e,this._listeners.length),this._deliverQueue(l)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},qU=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}},Z_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new xe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new xe,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}};Z_.INSTANCE=new Z_;var a0=Z_;function KU(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}a0.INSTANCE.onDidChangeZoomLevel;function GU(e){return a0.INSTANCE.getZoomFactor(e)}a0.INSTANCE.onDidChangeFullscreen;var Va=typeof navigator=="object"?navigator.userAgent:"",Q_=Va.indexOf("Firefox")>=0,YU=Va.indexOf("AppleWebKit")>=0,c0=Va.indexOf("Chrome")>=0,XU=!c0&&Va.indexOf("Safari")>=0;Va.indexOf("Electron/")>=0;Va.indexOf("Android")>=0;var Tv=!1;if(typeof as.matchMedia=="function"){let e=as.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=as.matchMedia("(display-mode: fullscreen)");Tv=e.matches,KU(as,e,({matches:n})=>{Tv&&t.matches||(Tv=n)})}var pa="en",J_=!1,ey=!1,df=!1,nA=!1,Ph,hf=pa,Mk=pa,ZU,ni,Zo=globalThis,Nn,LE;typeof Zo.vscode<"u"&&typeof Zo.vscode.process<"u"?Nn=Zo.vscode.process:typeof process<"u"&&typeof((LE=process==null?void 0:process.versions)==null?void 0:LE.node)=="string"&&(Nn=process);var jE,QU=typeof((jE=Nn==null?void 0:Nn.versions)==null?void 0:jE.electron)=="string",JU=QU&&(Nn==null?void 0:Nn.type)==="renderer",zE;if(typeof Nn=="object"){J_=Nn.platform==="win32",ey=Nn.platform==="darwin",df=Nn.platform==="linux",df&&Nn.env.SNAP&&Nn.env.SNAP_REVISION,Nn.env.CI||Nn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ph=pa,hf=pa;let e=Nn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ph=t.userLocale,Mk=t.osLocale,hf=t.resolvedLanguage||pa,ZU=(zE=t.languagePack)==null?void 0:zE.translationsConfigFile}catch{}nA=!0}else typeof navigator=="object"&&!JU?(ni=navigator.userAgent,J_=ni.indexOf("Windows")>=0,ey=ni.indexOf("Macintosh")>=0,(ni.indexOf("Macintosh")>=0||ni.indexOf("iPad")>=0||ni.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,df=ni.indexOf("Linux")>=0,(ni==null?void 0:ni.indexOf("Mobi"))>=0,hf=globalThis._VSCODE_NLS_LANGUAGE||pa,Ph=navigator.language.toLowerCase(),Mk=Ph):console.error("Unable to resolve platform.");var rA=J_,Ti=ey,e$=df,Nk=nA,Ai=ni,Ks=hf,t$;(e=>{function t(){return Ks}e.value=t;function n(){return Ks.length===2?Ks==="en":Ks.length>=3?Ks[0]==="e"&&Ks[1]==="n"&&Ks[2]==="-":!1}e.isDefaultVariant=n;function r(){return Ks==="en"}e.isDefault=r})(t$||(t$={}));var n$=typeof Zo.postMessage=="function"&&!Zo.importScripts;(()=>{if(n$){let e=[];Zo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let l=e[r];if(l.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Zo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var r$=!!(Ai&&Ai.indexOf("Chrome")>=0);Ai&&Ai.indexOf("Firefox")>=0;!r$&&Ai&&Ai.indexOf("Safari")>=0;Ai&&Ai.indexOf("Edg/")>=0;Ai&&Ai.indexOf("Android")>=0;var sa=typeof navigator=="object"?navigator:{};Nk||document.queryCommandSupported&&document.queryCommandSupported("copy")||sa&&sa.clipboard&&sa.clipboard.writeText,Nk||sa&&sa.clipboard&&sa.clipboard.readText;var u0=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}},Mv=new u0,Ak=new u0,Dk=new u0,i$=new Array(230),iA;(e=>{function t(u){return Mv.keyCodeToStr(u)}e.toString=t;function n(u){return Mv.strToKeyCode(u)}e.fromString=n;function r(u){return Ak.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return Dk.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function l(u){return Ak.strToKeyCode(u)||Dk.strToKeyCode(u)}e.fromUserSettings=l;function a(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 Mv.keyCodeToStr(u)}e.toElectronAccelerator=a})(iA||(iA={}));var s$=class sA{constructor(t,n,r,s,l){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=l}equals(t){return t instanceof sA&&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 o$([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},o$=class{constructor(e){if(e.length===0)throw AU("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 l$(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return iA.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Q_)switch(t){case 59:return 85;case 60:if(e$)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ti)return 57;break}else if(YU&&(Ti&&t===93||!Ti&&t===92))return 57;return i$[t]||0}var a$=Ti?256:2048,c$=512,u$=1024,d$=Ti?2048:256,Ok=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=l$(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|=a$),this.altKey&&(t|=c$),this.shiftKey&&(t|=u$),this.metaKey&&(t|=d$),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new s$(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Lk=new WeakMap;function h$(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 f$=class{static getSameOriginWindowChain(e){let t=Lk.get(e);if(!t){t=[],Lk.set(e,t);let n=e,r;do r=h$(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 l of s){let a=l.window.deref();if(n+=(a==null?void 0:a.scrollY)??0,r+=(a==null?void 0:a.scrollX)??0,a===t||!l.iframeElement)break;let u=l.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},Bh=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=f$.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},jk=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(c0){let l=navigator.userAgent.match(/Chrome\/(\d+)/);r=(l?parseInt(l[1]):123)<=122}if(e){let l=e,a=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof l.wheelDeltaY<"u")r?this.deltaY=l.wheelDeltaY/(120*u):this.deltaY=l.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Q_&&!Ti?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")XU&&rA?this.deltaX=-(l.wheelDeltaX/120):r?this.deltaX=l.wheelDeltaX/(120*u):this.deltaX=l.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Q_&&!Ti?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()}},oA=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),p$;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof m$?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:An.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:oA})})(p$||(p$={}));var m$=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?oA:(this._emitter||(this._emitter=new xe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},d0=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 q_("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new q_("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},g$=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 q_("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=jt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},v$;(e=>{async function t(r){let s,l=await Promise.all(r.map(a=>a.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return l}e.settled=t;function n(r){return new Promise(async(s,l)=>{try{await r(s,l)}catch(a){l(a)}})}e.withAsyncBody=n})(v$||(v$={}));var zk=class Ir{static fromArray(t){return new Ir(n=>{n.emitMany(t)})}static fromPromise(t){return new Ir(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Ir(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Ir(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 xe,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 An.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 Ir(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return Ir.map(this,t)}static filter(t,n){return new Ir(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return Ir.filter(this,t)}static coalesce(t){return Ir.filter(t,n=>!!n)}coalesce(){return Ir.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Ir.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())}};zk.EMPTY=zk.fromArray([]);var{getWindow:ki,getWindowId:_$,onDidRegisterWindow:y$}=(function(){let e=new Map,t={window:as,disposables:new lo};e.set(as.vscodeWindowId,t);let n=new xe,r=new xe,s=new xe;function l(a,u){return(typeof a=="number"?e.get(a):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Ge.None;let u=new lo,h={window:a,disposables:u.add(new lo)};return e.set(a.vscodeWindowId,h),u.add(jt(()=>{e.delete(a.vscodeWindowId),r.fire(a)})),u.add(He(a,mn.BEFORE_UNLOAD,()=>{s.fire(a)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:l,getWindow(a){var d;let u=a;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=a;return h!=null&&h.view?h.view.window:as},getDocument(a){return ki(a).document}}})(),b$=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 He(e,t,n,r){return new b$(e,t,n,r)}var Pk=function(e,t,n,r){return He(e,t,n,r)},h0,x$=class extends g${constructor(e){super(),this.defaultTarget=e&&ki(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},Bk=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){uf(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=l=>{n.set(l,!1);let a=e.get(l)??[];for(t.set(l,a),e.set(l,[]),r.set(l,!0);a.length>0;)a.sort(Bk.sort),a.shift().execute();r.set(l,!1)};h0=(l,a,u=0)=>{let h=_$(l),d=new Bk(a,u),p=e.get(h);return p||(p=[],e.set(h,p)),p.push(d),n.get(h)||(n.set(h,!0),l.requestAnimationFrame(()=>s(h))),d}})();function S$(e){let t=e.getBoundingClientRect(),n=ki(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var mn={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"},w$=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=ir(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ir(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ir(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ir(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ir(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ir(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ir(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ir(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ir(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ir(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ir(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=ir(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=ir(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ir(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 ir(e){return typeof e=="number"?`${e}px`:e}function bu(e){return new w$(e)}var lA=class{constructor(){this._hooks=new lo,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 l=e;try{e.setPointerCapture(t),this._hooks.add(jt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=ki(e)}this._hooks.add(He(l,mn.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(He(l,mn.POINTER_UP,a=>this.stopMonitoring(!0)))}};function C$(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 l=`$memoize$${t}`;n[r]=function(...a){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,a)}),this[l]}}var _i;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(_i||(_i={}));var ou=class Ln extends Ge{constructor(){super(),this.dispatched=!1,this.targets=new Tk,this.ignoreTargets=new Tk,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(An.runAndSubscribe(y$,({window:t,disposables:n})=>{n.add(He(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(He(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(He(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:as,disposables:this._store}))}static addTarget(t){if(!Ln.isTouchDevice())return Ge.None;Ln.INSTANCE||(Ln.INSTANCE=new Ln);let n=Ln.INSTANCE.targets.push(t);return jt(n)}static ignoreTarget(t){if(!Ln.isTouchDevice())return Ge.None;Ln.INSTANCE||(Ln.INSTANCE=new Ln);let n=Ln.INSTANCE.ignoreTargets.push(t);return jt(n)}static isTouchDevice(){return"ontouchstart"in as||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 l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:n,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[n],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let a=this.newGestureEvent(_i.Start,l.target);a.pageX=l.pageX,a.pageY=l.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let l=0,a=n.changedTouches.length;l<a;l++){let u=n.changedTouches.item(l);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<Ln.HOLD_DELAY&&Math.abs(h.initialPageX-yr(h.rollingPageX))<30&&Math.abs(h.initialPageY-yr(h.rollingPageY))<30){let p=this.newGestureEvent(_i.Tap,h.initialTarget);p.pageX=yr(h.rollingPageX),p.pageY=yr(h.rollingPageY),this.dispatchEvent(p)}else if(d>=Ln.HOLD_DELAY&&Math.abs(h.initialPageX-yr(h.rollingPageX))<30&&Math.abs(h.initialPageY-yr(h.rollingPageY))<30){let p=this.newGestureEvent(_i.Contextmenu,h.initialTarget);p.pageX=yr(h.rollingPageX),p.pageY=yr(h.rollingPageY),this.dispatchEvent(p)}else if(s===1){let p=yr(h.rollingPageX),m=yr(h.rollingPageY),_=yr(h.rollingTimestamps)-h.rollingTimestamps[0],y=p-h.rollingPageX[0],S=m-h.rollingPageY[0],w=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,w,r,Math.abs(y)/_,y>0?1:-1,p,Math.abs(S)/_,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(_i.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===_i.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Ln.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===_i.Change||t.type===_i.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,l=t.initialTarget;for(;l&&l!==r;)s++,l=l.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,l,a,u,h,d){this.handle=h0(t,()=>{let p=Date.now(),m=p-r,_=0,y=0,S=!0;s+=Ln.SCROLL_FRICTION*m,u+=Ln.SCROLL_FRICTION*m,s>0&&(S=!1,_=l*s*m),u>0&&(S=!1,y=h*u*m);let w=this.newGestureEvent(_i.Change);w.translationX=_,w.translationY=y,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,p,s,l,a+_,u,h,d+y)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let a=this.activeTouches[l.identifier],u=this.newGestureEvent(_i.Change,a.initialTarget);u.translationX=l.pageX-yr(a.rollingPageX),u.translationY=l.pageY-yr(a.rollingPageY),u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(l.pageX),a.rollingPageY.push(l.pageY),a.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ou.SCROLL_FRICTION=-.005,ou.HOLD_DELAY=700,ou.CLEAR_TAP_COUNT_TIME=400,Wt([C$],ou,"isTouchDevice",1);var k$=ou,f0=class extends Ge{onclick(e,t){this._register(He(e,mn.CLICK,n=>t(new Bh(ki(e),n))))}onmousedown(e,t){this._register(He(e,mn.MOUSE_DOWN,n=>t(new Bh(ki(e),n))))}onmouseover(e,t){this._register(He(e,mn.MOUSE_OVER,n=>t(new Bh(ki(e),n))))}onmouseleave(e,t){this._register(He(e,mn.MOUSE_LEAVE,n=>t(new Bh(ki(e),n))))}onkeydown(e,t){this._register(He(e,mn.KEY_DOWN,n=>t(new Ok(n))))}onkeyup(e,t){this._register(He(e,mn.KEY_UP,n=>t(new Ok(n))))}oninput(e,t){this._register(He(e,mn.INPUT,t))}onblur(e,t){this._register(He(e,mn.BLUR,t))}onfocus(e,t){this._register(He(e,mn.FOCUS,t))}onchange(e,t){this._register(He(e,mn.CHANGE,t))}ignoreGesture(e){return k$.ignoreTarget(e)}},Ik=11,E$=class extends f0{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=Ik+"px",this.domNode.style.height=Ik+"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 lA),this._register(Pk(this.bgDomNode,mn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Pk(this.domNode,mn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new x$),this._pointerdownScheduleRepeatTimer=this._register(new d0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ki(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()}},R$=class ty{constructor(t,n,r,s,l,a,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,l=l|0,a=a|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),l<0&&(l=0),u+l>a&&(u=a-l),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=l,this.scrollHeight=a,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 ty(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 ty(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,l=this.scrollLeft!==t.scrollLeft,a=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:l,heightChanged:a,scrollHeightChanged:u,scrollTopChanged:h}}},T$=class extends Ge{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new R$(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 Fk(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=Fk.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)))}},Hk=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Nv(e,t){let n=t-e;return function(r){return e+n*A$(r)}}function M$(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Fk=class ny{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,l;return t<n?(s=t+.75*r,l=n-.75*r):(s=t-.75*r,l=n+.75*r),M$(Nv(t,s),Nv(l,n),.33)}return Nv(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 Hk(r,s,!1)}return new Hk(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return ny.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new ny(t,n,s,r)}};function N$(e){return Math.pow(e,3)}function A$(e){return 1-N$(1-e)}var D$=class extends Ge{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 d0)}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":"")))}},O$=140,aA=class extends f0{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 D$(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lA),this._shouldRender=!0,this.domNode=bu(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(He(this.domNode.domNode,mn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new E$(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=bu(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(He(this.slider.domNode,mn.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=S$(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 l=this._sliderOrthogonalPointerPosition(s),a=Math.abs(l-n);if(rA&&a>O$){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()}},cA=class ry{constructor(t,n,r,s,l,a){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=l,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ry(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,l){let a=Math.max(0,r-t),u=Math.max(0,a-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),p=(u-d)/(s-r),m=l*p;return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=ry._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)}},L$=class extends aA{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new cA(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}},j$=class extends aA{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new cA(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}},z$=500,Uk=50,P$=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},iy=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 l=s===this._front?t:Math.pow(2,-r);if(t-=l,n+=this._memory[s].score*l,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(c0){let n=ki(t.browserEvent),r=GU(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,l=new P$(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,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]=l),l.score=this._computeScore(l,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),l=Math.abs(t.deltaY),a=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,a),1),d=Math.max(Math.min(l,u),1),p=Math.max(s,a),m=Math.max(l,u);p%h===0&&m%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};iy.INSTANCE=new iy;var B$=iy,I$=class extends f0{constructor(e,t,n){super(),this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new xe),this.onWillScroll=this._onWillScroll.event,this._options=F$(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 j$(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new L$(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=bu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bu(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 d0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=il(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,Ti&&(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 jk(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=il(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new jk(n))};this._mouseWheelToDispose.push(He(this._listenOnDomNode,mn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=B$.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+l===0?a=l=0:Math.abs(l)>=Math.abs(a)?a=0:l=0),this._options.flipAxes&&([l,a]=[a,l]);let u=!Ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!a&&(a=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(l){let p=Uk*l,m=h.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(d,m)}if(a){let p=Uk*a,m=h.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(d,m)}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":"",l=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${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(),z$)}},H$=class extends I${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 F$(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,Ti&&(t.className+=" mac"),t}var sy=class extends Ge{constructor(e,t,n,r,s,l,a,u){super(),this._bufferService=n,this._optionsService=a,this._renderService=u,this._onRequestScrollLines=this._register(new xe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new T$({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>h0(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new H$(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(An.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(jt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(jt(()=>this._styleElement.remove())),this._register(An.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
496
|
+
`)})),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}};sy=Wt([Ee(2,Kn),Ee(3,vs),Ee(4,$N),Ee(5,Wa),Ee(6,Gn),Ee(7,_s)],sy);var oy=class extends Ge{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(l=>this._removeDecoration(l))),this._register(jt(()=>{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()}};oy=Wt([Ee(1,Kn),Ee(2,vs),Ee(3,td),Ee(4,_s)],oy);var U$=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)}},gi={full:0,left:0,center:0,right:0},Gs={full:0,left:0,center:0,right:0},Wc={full:0,left:0,center:0,right:0},If=class extends Ge{constructor(e,t,n,r,s,l,a,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=l,this._themeService=a,this._coreBrowserService=u,this._colorZoneStore=new U$,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(jt(()=>{var p;return(p=this._canvas)==null?void 0:p.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);Gs.full=this._canvas.width,Gs.left=e,Gs.center=t,Gs.right=e,this._refreshDrawHeightConstants(),Wc.full=1,Wc.left=1,Wc.center=1+Gs.left,Wc.right=1+Gs.left+Gs.center}_refreshDrawHeightConstants(){gi.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);gi.left=t,gi.center=t,gi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.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(Wc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-gi[e.position||"full"]/2),Gs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+gi[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}))}};If=Wt([Ee(2,Kn),Ee(3,td),Ee(4,_s),Ee(5,Gn),Ee(6,Wa),Ee(7,vs)],If);var me;(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=`
|
|
497
|
+
`,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=""))(me||(me={}));var ff;(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=""))(ff||(ff={}));var uA;(e=>e.ST=`${me.ESC}\\`)(uA||(uA={}));var ly=class{constructor(e,t,n,r,s,l){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=l,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(`${me.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 l=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};ly=Wt([Ee(2,Kn),Ee(3,Gn),Ee(4,pl),Ee(5,_s)],ly);var bn=0,xn=0,Sn=0,$t=0,$k={css:"#00000000",rgba:0},tn;(e=>{function t(s,l,a,u){return u!==void 0?`#${Fo(s)}${Fo(l)}${Fo(a)}${Fo(u)}`:`#${Fo(s)}${Fo(l)}${Fo(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})(tn||(tn={}));var Nt;(e=>{function t(h,d){if($t=(d.rgba&255)/255,$t===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,m=d.rgba>>16&255,_=d.rgba>>8&255,y=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;bn=y+Math.round((p-y)*$t),xn=S+Math.round((m-S)*$t),Sn=w+Math.round((_-w)*$t);let C=tn.toCss(bn,xn,Sn),k=tn.toRgba(bn,xn,Sn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,p){let m=pf.ensureContrastRatio(h.rgba,d.rgba,p);if(m)return tn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[bn,xn,Sn]=pf.toChannels(d),{css:tn.toCss(bn,xn,Sn),rgba:d}}e.opaque=s;function l(h,d){return $t=Math.round(d*255),[bn,xn,Sn]=pf.toChannels(h.rgba),{css:tn.toCss(bn,xn,Sn,$t),rgba:tn.toRgba(bn,xn,Sn,$t)}}e.opacity=l;function a(h,d){return $t=h.rgba&255,l(h,$t*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(Nt||(Nt={}));var It;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,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 bn=parseInt(s.slice(1,2).repeat(2),16),xn=parseInt(s.slice(2,3).repeat(2),16),Sn=parseInt(s.slice(3,4).repeat(2),16),tn.toColor(bn,xn,Sn);case 5:return bn=parseInt(s.slice(1,2).repeat(2),16),xn=parseInt(s.slice(2,3).repeat(2),16),Sn=parseInt(s.slice(3,4).repeat(2),16),$t=parseInt(s.slice(4,5).repeat(2),16),tn.toColor(bn,xn,Sn,$t);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 l=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(l)return bn=parseInt(l[1]),xn=parseInt(l[2]),Sn=parseInt(l[3]),$t=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),tn.toColor(bn,xn,Sn,$t);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),[bn,xn,Sn,$t]=t.getImageData(0,0,1,1).data,$t!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:tn.toRgba(bn,xn,Sn,$t),css:s}}e.toColor=r})(It||(It={}));var Un;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Un||(Un={}));var pf;(e=>{function t(a,u){if($t=(u&255)/255,$t===1)return u;let h=u>>24&255,d=u>>16&255,p=u>>8&255,m=a>>24&255,_=a>>16&255,y=a>>8&255;return bn=m+Math.round((h-m)*$t),xn=_+Math.round((d-_)*$t),Sn=y+Math.round((p-y)*$t),tn.toRgba(bn,xn,Sn)}e.blend=t;function n(a,u,h){let d=Un.relativeLuminance(a>>8),p=Un.relativeLuminance(u>>8);if(is(d,p)<h){if(p<d){let y=r(a,u,h),S=is(d,Un.relativeLuminance(y>>8));if(S<h){let w=s(a,u,h),C=is(d,Un.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(a,u,h),_=is(d,Un.relativeLuminance(m>>8));if(_<h){let y=r(a,u,h),S=is(d,Un.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));for(;w<h&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));for(;w<h&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(pf||(pf={}));function Fo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function is(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var $$=class extends ed{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()]}},Hf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Vr}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,l=0,a=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 p=this._getJoinedRanges(r,a,l,t,s);for(let m=0;m<p.length;m++)n.push(p[m])}s=d,a=l,u=this._workCell.fg,h=this._workCell.bg}l+=this._workCell.getChars().length||so.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,a,l,t,s);for(let p=0;p<d.length;p++)n.push(d[p])}return n}_getJoinedRanges(e,t,n,r,s){let l=e.substring(t,n),a=[];try{a=this._characterJoiners[0].handler(l)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(l);for(let d=0;d<h.length;d++)Hf._mergeRanges(a,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(a,r,s),a}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,l=0,a=e[r];if(a){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||so.length;if(h!==0){if(!s&&a[0]<=l&&(a[0]=u,s=!0),a[1]<=l){if(a[1]=u,a=e[++r],!a)break;a[0]<=l?(a[0]=u,s=!0):s=!1}l+=d}}a&&(a[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}};Hf=Wt([Ee(0,Kn)],Hf);function W$(e){return 57508<=e&&e<=57558}function V$(e){return 9472<=e&&e<=9631}function q$(e){return W$(e)||V$(e)}function K$(){return{css:{canvas:Ih(),cell:Ih()},device:{canvas:Ih(),cell:Ih(),char:{width:0,height:0,left:0,top:0}}}}function Ih(){return{width:0,height:0}}var ay=class{constructor(e,t,n,r,s,l,a){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=l,this._themeService=a,this._workCell=new Vr,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,l,a,u,h,d,p){let m=[],_=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<l+1&&(S=l+1);let w,C=0,k="",T=0,R=0,M=0,O=0,D=!1,j=0,F=!1,G=0,P=0,W=[],I=d!==-1&&p!==-1;for(let $=0;$<S;$++){e.loadCell($,this._workCell);let U=this._workCell.getWidth();if(U===0)continue;let H=!1,B=$>=P,q=$,V=this._workCell;if(_.length>0&&$===_[0][0]&&B){let ke=_.shift(),Be=this._isCellInSelection(ke[0],t);for(T=ke[0]+1;T<ke[1];T++)B&&(B=Be===this._isCellInSelection(T,t));B&&(B=!n||l<ke[0]||l>=ke[1]),B?(H=!0,V=new $$(this._workCell,e.translateToString(!0,ke[0],ke[1]),ke[1]-ke[0]),q=ke[1]-1,U=V.getWidth()):P=ke[1]}let Z=this._isCellInSelection($,t),N=n&&$===l,z=I&&$>=d&&$<=p,Y=!1;this._decorationService.forEachDecorationAtCell($,t,void 0,ke=>{Y=!0});let A=V.getChars()||so;if(A===" "&&(V.isUnderline()||V.isOverline())&&(A=" "),G=U*u-h.get(A,V.isBold(),V.isItalic()),!w)w=this._document.createElement("span");else if(C&&(Z&&F||!Z&&!F&&V.bg===R)&&(Z&&F&&y.selectionForeground||V.fg===M)&&V.extended.ext===O&&z===D&&G===j&&!N&&!H&&!Y&&B){V.isInvisible()?k+=so:k+=A,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=V.bg,M=V.fg,O=V.extended.ext,D=z,j=G,F=Z,H&&l>=$&&l<=q&&(l=$),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&W.push("xterm-cursor-blink"),W.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline");break}}if(V.isBold()&&W.push("xterm-bold"),V.isItalic()&&W.push("xterm-italic"),V.isDim()&&W.push("xterm-dim"),V.isInvisible()?k=so:k=V.getChars()||so,V.isUnderline()&&(W.push(`xterm-underline-${V.extended.underlineStyle}`),k===" "&&(k=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${ed.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let ke=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&ke<8&&(ke+=8),w.style.textDecorationColor=y.ansi[ke].css}V.isOverline()&&(W.push("xterm-overline"),k===" "&&(k=" ")),V.isStrikethrough()&&W.push("xterm-strikethrough"),z&&(w.style.textDecoration="underline");let oe=V.getFgColor(),fe=V.getFgColorMode(),se=V.getBgColor(),J=V.getBgColorMode(),ge=!!V.isInverse();if(ge){let ke=oe;oe=se,se=ke;let Be=fe;fe=J,J=Be}let ie,ce,we=!1;this._decorationService.forEachDecorationAtCell($,t,void 0,ke=>{ke.options.layer!=="top"&&we||(ke.backgroundColorRGB&&(J=50331648,se=ke.backgroundColorRGB.rgba>>8&16777215,ie=ke.backgroundColorRGB),ke.foregroundColorRGB&&(fe=50331648,oe=ke.foregroundColorRGB.rgba>>8&16777215,ce=ke.foregroundColorRGB),we=ke.options.layer==="top")}),!we&&Z&&(ie=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,se=ie.rgba>>8&16777215,J=50331648,we=!0,y.selectionForeground&&(fe=50331648,oe=y.selectionForeground.rgba>>8&16777215,ce=y.selectionForeground)),we&&W.push("xterm-decoration-top");let Se;switch(J){case 16777216:case 33554432:Se=y.ansi[se],W.push(`xterm-bg-${se}`);break;case 50331648:Se=tn.toColor(se>>16,se>>8&255,se&255),this._addStyle(w,`background-color:#${Wk((se>>>0).toString(16),"0",6)}`);break;case 0:default:ge?(Se=y.foreground,W.push("xterm-bg-257")):Se=y.background}switch(ie||V.isDim()&&(ie=Nt.multiplyOpacity(Se,.5)),fe){case 16777216:case 33554432:V.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(w,Se,y.ansi[oe],V,ie,void 0)||W.push(`xterm-fg-${oe}`);break;case 50331648:let ke=tn.toColor(oe>>16&255,oe>>8&255,oe&255);this._applyMinimumContrast(w,Se,ke,V,ie,ce)||this._addStyle(w,`color:#${Wk(oe.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,Se,y.foreground,V,ie,ce)||ge&&W.push("xterm-fg-257")}W.length&&(w.className=W.join(" "),W.length=0),!N&&!H&&!Y&&B?C++:w.textContent=k,G!==this.defaultSpacing&&(w.style.letterSpacing=`${G}px`),m.push(w),$=q}return w&&C&&(w.textContent=k),m}_applyMinimumContrast(e,t,n,r,s,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||q$(r.getCode()))return!1;let a=this._getContrastCache(r),u;if(!s&&!l&&(u=a.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=Nt.ensureContrastRatio(s||t,l||n,h),a.setColor((s||t).rgba,(l||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]}};ay=Wt([Ee(1,qN),Ee(2,Gn),Ee(3,vs),Ee(4,pl),Ee(5,td),Ee(6,Wa)],ay);function Wk(e,t,n){for(;e.length<n;)e=t+e;return e}var G$=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 l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[n,r,s,l],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(l),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 a=this._measure(e,0);return a>0&&(this._flat[r]=a),a}let s=e;t&&(s+="B"),n&&(s+="I");let l=this._holey.get(s);if(l===void 0){let a=0;t&&(a|=1),n&&(a|=2),l=this._measure(e,a),l>0&&this._holey.set(s,l)}return l}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},Y$=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,l=t[1]-s,a=n[1]-s,u=Math.max(l,0),h=Math.min(a,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=a,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 X$(){return new Y$}var Av="xterm-dom-renderer-owner-",Br="xterm-rows",Hh="xterm-fg-",Vk="xterm-bg-",Vc="xterm-focus",Fh="xterm-selection",Z$=1,cy=class extends Ge{constructor(e,t,n,r,s,l,a,u,h,d,p,m,_,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=l,this._linkifier2=a,this._charSizeService=h,this._optionsService=d,this._bufferService=p,this._coreService=m,this._coreBrowserService=_,this._themeService=y,this._terminalClass=Z$++,this._rowElements=[],this._selectionRenderModel=X$(),this.onRequestRedraw=this._register(new xe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Br),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(Fh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=K$(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(ay,document),this._element.classList.add(Av+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(jt(()=>{this._element.classList.remove(Av+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new G$(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} .${Br} 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} .${Br} { 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} .${Br} .xterm-dim { color: ${Nt.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} .${Br}.${Vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Br}.${Vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Br}.${Vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Fh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Fh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Fh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())t+=`${this._terminalSelector} .${Hh}${l} { color: ${a.css}; }${this._terminalSelector} .${Hh}${l}.xterm-dim { color: ${Nt.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${Vk}${l} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${Hh}257 { color: ${Nt.opaque(e.background).css}; }${this._terminalSelector} .${Hh}257.xterm-dim { color: ${Nt.multiplyOpacity(Nt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Vk}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(Vc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vc),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,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(l,h?t[0]:e[0],h?e[0]:t[0],a-l+1))}else{let h=r===l?e[0]:0,d=l===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,h,d));let p=a-l-1;if(u.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,p)),l!==a){let m=s===a?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,0,m))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(n-t);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${l}px`,s.style.width=`${a}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),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=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,p=this._rowElements[h],m=n.lines.get(d);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,d,d===r,a,u,s,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Av}${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,l){n<0&&(e=0),r<0&&(t=0);let a=this._bufferService.rows-1;n=Math.max(Math.min(n,a),0),r=Math.max(Math.min(r,a),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),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let S=y+u.ydisp,w=this._rowElements[y],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===h,m,_,d,p,this.dimensions.css.cell.width,this._widthCache,l?y===n?e:0:-1,l?(y===r?t:s)-1:-1))}}};cy=Wt([Ee(7,o0),Ee(8,Rp),Ee(9,Gn),Ee(10,Kn),Ee(11,pl),Ee(12,vs),Ee(13,Wa)],cy);var uy=class extends Ge{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new xe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new J$(this._optionsService))}catch{this._measureStrategy=this._register(new Q$(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())}};uy=Wt([Ee(2,Gn)],uy);var dA=class extends Ge{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)}},Q$=class extends dA{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}},J$=class extends dA{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}},eW=class extends Ge{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 tW(this._window)),this._onDprChange=this._register(new xe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new xe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(An.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(He(this._textarea,"focus",()=>this._isFocused=!0)),this._register(He(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}},tW=class extends Ge{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ta),this._onDprChange=this._register(new xe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(jt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=He(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)}},nW=class extends Ge{constructor(){super(),this.linkProviders=[],this._register(jt(()=>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 p0(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),l=parseInt(s.getPropertyValue("padding-left")),a=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-a]}function rW(e,t,n,r,s,l,a,u,h){if(!l)return;let d=p0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?a/2:0))/a),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 dy=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return rW(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=p0(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])}}};dy=Wt([Ee(0,_s),Ee(1,Rp)],dy);var iW=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=[]}},hA={};pU(hA,{getSafariVersion:()=>oW,isChromeOS:()=>gA,isFirefox:()=>fA,isIpad:()=>lW,isIphone:()=>aW,isLegacyEdge:()=>sW,isLinux:()=>m0,isMac:()=>Ff,isNode:()=>Tp,isSafari:()=>pA,isWindows:()=>mA});var Tp=typeof process<"u"&&"title"in process,nd=Tp?"node":navigator.userAgent,rd=Tp?"node":navigator.platform,fA=nd.includes("Firefox"),sW=nd.includes("Edge"),pA=/^((?!chrome|android).)*safari/i.test(nd);function oW(){if(!pA)return 0;let e=nd.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Ff=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(rd),lW=rd==="iPad",aW=rd==="iPhone",mA=["Windows","Win16","Win32","WinCE"].includes(rd),m0=rd.indexOf("Linux")>=0,gA=/\bCrOS\b/.test(nd),vA=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()}},cW=class extends vA{_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())}}},uW=class extends vA{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Uf=!Tp&&"requestIdleCallback"in window?uW:cW,dW=class{constructor(){this._queue=new Uf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},hy=class extends Ge{constructor(e,t,n,r,s,l,a,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new Ta),this._pausedResizeTask=new dW,this._observerDisposable=this._register(new Ta),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 xe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new xe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new xe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new xe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new iW((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new hW(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(jt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.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(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.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=jt(()=>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()}};hy=Wt([Ee(2,Gn),Ee(3,Rp),Ee(4,pl),Ee(5,td),Ee(6,Kn),Ee(7,vs),Ee(8,Wa)],hy);var hW=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 fW(e,t,n,r){let s=n.buffer.x,l=n.buffer.y;if(!n.buffer.hasScrollback)return gW(s,l,e,t,n,r)+Mp(l,t,n,r)+vW(s,l,e,t,n,r);let a;if(l===t)return a=s>e?"D":"C",zu(Math.abs(s-e),ju(a,r));a=l>t?"D":"C";let u=Math.abs(l-t),h=mW(l>t?e:s,n)+(u-1)*n.cols+1+pW(l>t?s:e);return zu(h,ju(a,r))}function pW(e,t){return e-1}function mW(e,t){return t.cols-e}function gW(e,t,n,r,s,l){return Mp(t,r,s,l).length===0?"":zu(yA(e,t,e,t-sl(t,s),!1,s).length,ju("D",l))}function Mp(e,t,n,r){let s=e-sl(e,n),l=t-sl(t,n),a=Math.abs(s-l)-_W(e,t,n);return zu(a,ju(_A(e,t),r))}function vW(e,t,n,r,s,l){let a;Mp(t,r,s,l).length>0?a=r-sl(r,s):a=t;let u=r,h=yW(e,t,n,r,s,l);return zu(yA(e,a,n,u,h==="C",s).length,ju(h,l))}function _W(e,t,n){var a;let r=0,s=e-sl(e,n),l=t-sl(t,n);for(let u=0;u<Math.abs(s-l);u++){let h=_A(e,t)==="A"?-1:1;(a=n.buffer.lines.get(s+h*u))!=null&&a.isWrapped&&r++}return r}function sl(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 yW(e,t,n,r,s,l){let a;return Mp(n,r,s,l).length>0?a=r-sl(r,s):a=t,e<n&&a<=r||e>=n&&a<r?"C":"D"}function _A(e,t){return e>t?"A":"B"}function yA(e,t,n,r,s,l){let a=e,u=t,h="";for(;(a!==n||u!==r)&&u>=0&&u<l.buffer.lines.length;)a+=s?1:-1,s&&a>l.cols-1?(h+=l.buffer.translateBufferLineToString(u,!1,e,a),a=0,e=0,u++):!s&&a<0&&(h+=l.buffer.translateBufferLineToString(u,!1,0,e+1),a=l.cols-1,e=a,u--);return h+l.buffer.translateBufferLineToString(u,!1,e,a)}function ju(e,t){let n=t?"O":"[";return me.ESC+n+e}function zu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var bW=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 qk(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 Dv=50,xW=15,SW=50,wW=500,CW=" ",kW=new RegExp(CW,"g"),fy=class extends Ge{constructor(e,t,n,r,s,l,a,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=l,this._optionsService=a,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Vr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new xe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new xe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new xe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new xe),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 bW(this._bufferService),this._activeSelectionMode=0,this._register(jt(()=>{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],l=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let u=n.translateBufferLineToString(a,!0,s,l);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 l=e[1]+1;l<=t[1]-1;l++){let a=n.lines.get(l),u=n.translateBufferLineToString(l,!0);a!=null&&a.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let l=n.lines.get(t[1]),a=n.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=a:r.push(a)}}return r.map(s=>s.replace(kW," ")).join(mA?`\r
|
|
498
|
+
`:`
|
|
499
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),m0&&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,l;let n=(l=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:l.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=qk(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=p0(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,-Dv),Dv),t/=Dv,t/Math.abs(t)+Math.round(t*(xW-1)))}shouldForceSelection(e){return Ff?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(),SW)}_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&&!(Ff&&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<wW&&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=fW(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,l=s.lines.get(e[1]);if(!l)return;let a=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(l,e[0]),h=u,d=e[0]-u,p=0,m=0,_=0,y=0;if(a.charAt(u)===" "){for(;u>0&&a.charAt(u-1)===" ";)u--;for(;h<a.length&&a.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];l.getWidth(C)===0&&(p++,C--),l.getWidth(k)===2&&(m++,k++);let T=l.getString(k).length;for(T>1&&(y+=T-1,h+=T-1);C>0&&u>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<l.length&&h+1<a.length&&!this._isCharWordSeparator(l.loadCell(k+1,this._workCell));){l.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(y+=R-1,h+=R-1),h++,k++}}h++;let S=u+d-p+_,w=Math.min(this._bufferService.cols,h-u+p+m-_-y);if(!(!t&&a.slice(u,h).trim()==="")){if(n&&S===0&&l.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&l.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 T=this._bufferService.cols-k.start;S-=T,w+=T}}}if(r&&S+w===this._bufferService.cols&&l.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&&(w+=k.length)}}return{start:S,length:w}}}_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=qk(n,this._bufferService.cols)}};fy=Wt([Ee(3,Kn),Ee(4,pl),Ee(5,l0),Ee(6,Gn),Ee(7,_s),Ee(8,vs)],fy);var Kk=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={}}},Gk=class{constructor(){this._color=new Kk,this._css=new Kk}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()}},an=Object.freeze((()=>{let e=[It.toColor("#2e3436"),It.toColor("#cc0000"),It.toColor("#4e9a06"),It.toColor("#c4a000"),It.toColor("#3465a4"),It.toColor("#75507b"),It.toColor("#06989a"),It.toColor("#d3d7cf"),It.toColor("#555753"),It.toColor("#ef2929"),It.toColor("#8ae234"),It.toColor("#fce94f"),It.toColor("#729fcf"),It.toColor("#ad7fa8"),It.toColor("#34e2e2"),It.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],l=t[n%6];e.push({css:tn.toCss(r,s,l),rgba:tn.toRgba(r,s,l)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:tn.toCss(r,r,r),rgba:tn.toRgba(r,r,r)})}return e})()),Vo=It.toColor("#ffffff"),lu=It.toColor("#000000"),Yk=It.toColor("#ffffff"),Xk=lu,qc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},EW=Vo,py=class extends Ge{constructor(e){super(),this._optionsService=e,this._contrastCache=new Gk,this._halfContrastCache=new Gk,this._onChangeColors=this._register(new xe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Vo,background:lu,cursor:Yk,cursorAccent:Xk,selectionForeground:void 0,selectionBackgroundTransparent:qc,selectionBackgroundOpaque:Nt.blend(lu,qc),selectionInactiveBackgroundTransparent:qc,selectionInactiveBackgroundOpaque:Nt.blend(lu,qc),scrollbarSliderBackground:Nt.opacity(Vo,.2),scrollbarSliderHoverBackground:Nt.opacity(Vo,.4),scrollbarSliderActiveBackground:Nt.opacity(Vo,.5),overviewRulerBorder:Vo,ansi:an.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=_t(e.foreground,Vo),t.background=_t(e.background,lu),t.cursor=Nt.blend(t.background,_t(e.cursor,Yk)),t.cursorAccent=Nt.blend(t.background,_t(e.cursorAccent,Xk)),t.selectionBackgroundTransparent=_t(e.selectionBackground,qc),t.selectionBackgroundOpaque=Nt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=_t(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Nt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?_t(e.selectionForeground,$k):void 0,t.selectionForeground===$k&&(t.selectionForeground=void 0),Nt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Nt.opacity(t.selectionBackgroundTransparent,.3)),Nt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Nt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=_t(e.scrollbarSliderBackground,Nt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=_t(e.scrollbarSliderHoverBackground,Nt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=_t(e.scrollbarSliderActiveBackground,Nt.opacity(t.foreground,.5)),t.overviewRulerBorder=_t(e.overviewRulerBorder,EW),t.ansi=an.slice(),t.ansi[0]=_t(e.black,an[0]),t.ansi[1]=_t(e.red,an[1]),t.ansi[2]=_t(e.green,an[2]),t.ansi[3]=_t(e.yellow,an[3]),t.ansi[4]=_t(e.blue,an[4]),t.ansi[5]=_t(e.magenta,an[5]),t.ansi[6]=_t(e.cyan,an[6]),t.ansi[7]=_t(e.white,an[7]),t.ansi[8]=_t(e.brightBlack,an[8]),t.ansi[9]=_t(e.brightRed,an[9]),t.ansi[10]=_t(e.brightGreen,an[10]),t.ansi[11]=_t(e.brightYellow,an[11]),t.ansi[12]=_t(e.brightBlue,an[12]),t.ansi[13]=_t(e.brightMagenta,an[13]),t.ansi[14]=_t(e.brightCyan,an[14]),t.ansi[15]=_t(e.brightWhite,an[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]=_t(e.extendedAnsi[r],an[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()}}};py=Wt([Ee(0,Gn)],py);function _t(e,t){if(e!==void 0)try{return It.toColor(e)}catch{}return t}var RW=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)}},TW=class{constructor(){this._services=new RW,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=xU(e).sort((l,a)=>l.index-a.index),r=[];for(let l of n){let a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(a)}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)}},MW={trace:0,debug:1,info:2,warn:3,error:4,off:5},NW="xterm.js: ",my=class extends Ge{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=MW[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?"":NW)+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)}};my=Wt([Ee(0,Gn)],my);var Zk=class extends Ge{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new xe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new xe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new xe),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}},qe=3,en=Object.freeze(new ed),Uh=0,Ov=2,au=class bA{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*qe);let s=n||Vr.fromCharData([0,IN,1,0]);for(let l=0;l<t;++l)this.setCell(l,s);this.length=t}get(t){let n=this._data[t*qe+0],r=n&2097151;return[this._data[t*qe+1],n&2097152?this._combined[t]:r?to(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*qe+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*qe+0]=t|2097152|n[2]<<22):this._data[t*qe+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*qe+0]>>22}hasWidth(t){return this._data[t*qe+0]&12582912}getFg(t){return this._data[t*qe+1]}getBg(t){return this._data[t*qe+2]}hasContent(t){return this._data[t*qe+0]&4194303}getCodePoint(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*qe+0]&2097152}getString(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t]:n&2097151?to(n&2097151):""}isProtected(t){return this._data[t*qe+2]&536870912}loadCell(t,n){return Uh=t*qe,n.content=this._data[Uh+0],n.fg=this._data[Uh+1],n.bg=this._data[Uh+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*qe+0]=n.content,this._data[t*qe+1]=n.fg,this._data[t*qe+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*qe+0]=n|r<<22,this._data[t*qe+1]=s.fg,this._data[t*qe+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*qe+0];s&2097152?this._combined[t]+=to(n):s&2097151?(this._combined[t]=to(s&2097151)+to(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*qe+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 Vr;for(let l=this.length-t-n-1;l>=0;--l)this.setCell(t+n+l,this.loadCell(t+l,s));for(let l=0;l<n;++l)this.setCell(t+l,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 Vr;for(let l=0;l<this.length-t-n;++l)this.setCell(t+l,this.loadCell(t+n+l,s));for(let l=this.length-n;l<this.length;++l)this.setCell(l,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*Ov<this._data.buffer.byteLength;let r=t*qe;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 a=0;a<s.length;a++){let u=parseInt(s[a],10);u>=t&&delete this._combined[u]}let l=Object.keys(this._extendedAttrs);for(let a=0;a<l.length;a++){let u=parseInt(l[a],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Ov<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Ov<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 bA(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*qe+0]&4194303)return t+(this._data[t*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303||this._data[t*qe+2]&50331648)return t+(this._data[t*qe+0]>>22);return 0}copyCellsFrom(t,n,r,s,l){let a=t._data;if(l)for(let h=s-1;h>=0;h--){for(let d=0;d<qe;d++)this._data[(r+h)*qe+d]=a[(n+h)*qe+d];a[(n+h)*qe+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<qe;d++)this._data[(r+h)*qe+d]=a[(n+h)*qe+d];a[(n+h)*qe+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 l="";for(;n<r;){let a=this._data[n*qe+0],u=a&2097151,h=a&2097152?this._combined[n]:u?to(u):so;if(l+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=a>>22||1}return s&&s.push(n),l}};function AW(e,t,n,r,s,l){let a=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let p=[e.get(u)];for(;h<e.length&&d.isWrapped;)p.push(d),d=e.get(++h);if(!l&&r>=u&&r<h){u+=p.length-1;continue}let m=0,_=Pu(p,m,t),y=1,S=0;for(;y<p.length;){let C=Pu(p,y,t),k=C-S,T=n-_,R=Math.min(k,T);p[m].copyCellsFrom(p[y],S,_,R,!1),_+=R,_===n&&(m++,_=0),S+=R,S===C&&(y++,S=0),_===0&&m!==0&&p[m-1].getWidth(n-1)===2&&(p[m].copyCellsFrom(p[m-1],n-1,_++,1,!1),p[m-1].setCell(n-1,s))}p[m].replaceCells(_,n,s);let w=0;for(let C=p.length-1;C>0&&(C>m||p[C].getTrimmedLength()===0);C--)w++;w>0&&(a.push(u+p.length-w),a.push(w)),u+=p.length-1}return a}function DW(e,t){let n=[],r=0,s=t[r],l=0;for(let a=0;a<e.length;a++)if(s===a){let u=t[++r];e.onDeleteEmitter.fire({index:a-l,amount:u}),a+=u-1,l+=u,s=t[++r]}else n.push(a);return{layout:n,countRemoved:l}}function OW(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 LW(e,t,n){let r=[],s=e.map((h,d)=>Pu(e,d,t)).reduce((h,d)=>h+d),l=0,a=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}l+=n;let h=Pu(e,a,t);l>h&&(l-=h,a++);let d=e[a].getWidth(l-1)===2;d&&l--;let p=d?n-1:n;r.push(p),u+=p}return r}function Pu(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 xA=class SA{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=SA._nextId++,this._onDispose=this.register(new xe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),il(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};xA._nextId=1;var jW=xA,dn={},qo=dn.B;dn[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:"≥","{":"π","|":"≠","}":"£","~":"·"};dn.A={"#":"£"};dn.B=void 0;dn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};dn.C=dn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};dn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};dn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};dn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};dn.E=dn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};dn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};dn.H=dn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Qk=4294967295,Jk=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=en.clone(),this.savedCharset=qo,this.markers=[],this._nullCell=Vr.fromCharData([0,IN,1,0]),this._whitespaceCell=Vr.fromCharData([0,so,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Uf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Zk(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 Bf),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 Bf),this._whitespaceCell}getBlankLine(e,t){return new au(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>Qk?Qk:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=en);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 Zk(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(en),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 a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);let l=0;if(this._rows<t)for(let a=this._rows;a<t;a++)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 au(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new au(e,n)));else for(let a=this._rows;a>t;a--)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 a=this.lines.length-s;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),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 l=0;l<this.lines.length;l++)r+=+this.lines.get(l).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=AW(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(en),n);if(r.length>0){let s=DW(this.lines,r);OW(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(en),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new au(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(en),s=[],l=0;for(let a=this.lines.length-1;a>=0;a--){let u=this.lines.get(a);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&a>0;)u=this.lines.get(--a),h.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=a&&R<a+h.length)continue}let d=h[h.length-1].getTrimmedLength(),p=LW(h,this._cols,e),m=p.length-h.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+m):_=Math.max(0,this.lines.length-this.lines.maxLength+m);let y=[];for(let R=0;R<m;R++){let M=this.getBlankLine(en,!0);y.push(M)}y.length>0&&(s.push({start:a+h.length+l,newLines:y}),l+=y.length),h.push(...y);let S=p.length-1,w=p[S];w===0&&(S--,w=p[S]);let C=h.length-m-1,k=d;for(;C>=0;){let R=Math.min(k,w);if(h[S]===void 0)break;if(h[S].copyCellsFrom(h[C],k-R,w-R,R,!0),w-=R,w===0&&(S--,w=p[S]),k-=R,k===0){C--;let M=Math.max(C,0);k=Pu(h,M,this._cols)}}for(let R=0;R<h.length;R++)p[R]<e&&h[R].setCell(p[R],r);let T=m-_;for(;T-- >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+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(s.length>0){let a=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let h=this.lines.length,d=h-1,p=0,m=s[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let _=0;for(let w=Math.min(this.lines.maxLength-1,h+l-1);w>=0;w--)if(m&&m.start>d+_){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(w--,m.newLines[C]);w++,a.push({index:d+1,amount:m.newLines.length}),_+=m.newLines.length,m=s[++p]}else this.lines.set(w,u[d--]);let y=0;for(let w=a.length-1;w>=0;w--)a[w].index+=y,this.lines.onInsertEmitter.fire(a[w]),y+=a[w].amount;let S=Math.max(0,h+l-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}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 jW(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)}},zW=class extends Ge{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new xe),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 Jk(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Jk(!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)}},wA=2,CA=1,gy=class extends Ge{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new xe),this.onResize=this._onResize.event,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,wA),this.rows=Math.max(e.rawOptions.rows||0,CA),this.buffers=this._register(new zW(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,l=n.ybase+n.scrollBottom;if(n.scrollTop===0){let a=n.lines.isFull;l===n.lines.length-1?a?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(l+1,0,r.clone()),a?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let a=l-s+1;n.lines.shiftElements(s+1,a-1,-1),n.lines.set(l,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))}};gy=Wt([Ee(0,Gn)],gy);var oa={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:Ff,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},PW=["normal","bold","100","200","300","400","500","600","700","800","900"],BW=class extends Ge{constructor(e){super(),this._onOptionChange=this._register(new xe),this.onOptionChange=this._onOptionChange.event;let t={...oa};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(jt(()=>{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 oa))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in oa))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=oa[e]),!IW(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=oa[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=PW.includes(t)?t:oa[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 IW(e){return e==="block"||e==="underline"||e==="bar"}function cu(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]&&cu(e[r],t-1);return n}var e2=Object.freeze({insertMode:!1}),t2=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),vy=class extends Ge{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 xe),this.onData=this._onData.event,this._onUserInput=this._register(new xe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new xe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new xe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=cu(e2),this.decPrivateModes=cu(t2)}reset(){this.modes=cu(e2),this.decPrivateModes=cu(t2)}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))}};vy=Wt([Ee(0,Kn),Ee(1,WN),Ee(2,Gn)],vy);var n2={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 Lv(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 jv=String.fromCharCode,r2={DEFAULT:e=>{let t=[Lv(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${jv(t[0])}${jv(t[1])}${jv(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Lv(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Lv(e,!0)};${e.x};${e.y}${t}`}},_y=class extends Ge{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 xe),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(n2))this.addProtocol(r,n2[r]);for(let r of Object.keys(r2))this.addEncoding(r,r2[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)}};_y=Wt([Ee(0,Kn),Ee(1,pl),Ee(2,Gn)],_y);var zv=[[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]],HW=[[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]],cn;function FW(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 UW=class{constructor(){if(this.version="6",!cn){cn=new Uint8Array(65536),cn.fill(1),cn[0]=0,cn.fill(0,1,32),cn.fill(0,127,160),cn.fill(2,4352,4448),cn[9001]=2,cn[9002]=2,cn.fill(2,11904,42192),cn[12351]=1,cn.fill(2,44032,55204),cn.fill(2,63744,64256),cn.fill(2,65040,65050),cn.fill(2,65072,65136),cn.fill(2,65280,65377),cn.fill(2,65504,65511);for(let e=0;e<zv.length;++e)cn.fill(0,zv[e][0],zv[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?cn[e]:FW(e,HW)?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=Xo.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Xo.createPropertyValue(0,n,r)}},Xo=class mf{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new xe,this.onChange=this._onChange.event;let t=new UW;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 l=0;l<s;++l){let a=t.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=s)return n+this.wcwidth(a);let d=t.charCodeAt(l);56320<=d&&d<=57343?a=(a-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(a,r),h=mf.extractWidth(u);mf.extractShouldJoin(u)&&(h-=mf.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},$W=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 i2(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 Kc=2147483647,WW=256,kA=class yy{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>WW)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 yy;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 l=0;l<s.length;++l)n.addSubParam(s[l]);else n.addParam(s)}return n}clone(){let t=new yy(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>Kc?Kc: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>Kc?Kc: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,Kc):t}},Gc=[],VW=class{constructor(){this._state=0,this._active=Gc,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=Gc}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=Gc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Gc,!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",Ep(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=Gc,this._id=-1,this._state=0}}},br=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+=Ep(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}},Yc=[],qW=class{constructor(){this._handlers=Object.create(null),this._active=Yc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yc}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=Yc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Yc,!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",Ep(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=Yc,this._ident=0}},uu=new kA;uu.addParam(0);var s2=class{constructor(e){this._handler=e,this._data="",this._params=uu,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():uu,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Ep(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=uu,this._data="",this._hitLimit=!1,n));return this._params=uu,this._data="",this._hitLimit=!1,t}},KW=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}},Ur=160,GW=(function(){let e=new KW(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 l=n(0,14),a;e.setDefault(1,0),e.addMany(r,0,2,0);for(a in l)e.addMany([24,26,153,154],a,3,0),e.addMany(n(128,144),a,3,0),e.addMany(n(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,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(Ur,0,2,0),e.add(Ur,8,5,8),e.add(Ur,6,0,6),e.add(Ur,11,0,11),e.add(Ur,13,13,13),e})(),YW=class extends Ge{constructor(e=GW){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 kA,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(jt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new VW),this._dcsParser=this._register(new qW),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 l=e.intermediates.charCodeAt(s);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=l}}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,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=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&&(a=u[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(a=u[h](),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(r!==24&&r!==26,n),a)return a;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],a=this._oscParser.end(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=l;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Ur)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-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&&(a=h[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(3,h,d,s,u),a;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 p=this._escHandlers[this._collect<<8|r],m=p?p.length-1:-1;for(;m>=0&&(a=p[m](),a!==!0);m--)if(a instanceof Promise)return this._preserveStack(4,p,m,s,u),a;m<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 _=u+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Ur){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(a=this._dcsParser.unhook(r!==24&&r!==26),a)return this._preserveStack(6,[],0,s,u),a;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 _=u+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Ur){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(a=this._oscParser.end(r!==24&&r!==26),a)return this._preserveStack(5,[],0,s,u),a;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},XW=/^([\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})$/,ZW=/^[\da-f]+$/;function o2(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=XW.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),ZW.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 l=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?l<<4:n===2?l:n===3?l>>4:l>>8}return r}}function Pv(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 QW(e,t=16){let[n,r,s]=e;return`rgb:${Pv(n,t)}/${Pv(r,t)}/${Pv(s,t)}`}var JW={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ys=131072,l2=10;function a2(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 c2=5e3,u2=0,eV=class extends Ge{constructor(e,t,n,r,s,l,a,u,h=new YW){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=l,this._coreMouseService=a,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new yU,this._utf8Decoder=new bU,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=en.clone(),this._eraseAttrDataInternal=en.clone(),this._onRequestBell=this._register(new xe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new xe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new xe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new xe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new xe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new xe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new xe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new xe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new xe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new xe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new xe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new xe),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 by(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.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,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:m})}),this._parser.setDcsHandlerFallback((d,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:m})}),this._parser.setPrintHandler((d,p,m)=>this.print(d,p,m)),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(me.BEL,()=>this.bell()),this._parser.setExecuteHandler(me.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(me.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(me.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(me.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(me.BS,()=>this.backspace()),this._parser.setExecuteHandler(me.HT,()=>this.tab()),this._parser.setExecuteHandler(me.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(me.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ff.IND,()=>this.index()),this._parser.setExecuteHandler(ff.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ff.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new br(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new br(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new br(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new br(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new br(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new br(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new br(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new br(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new br(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new br(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new br(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new br(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 dn)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 s2((d,p)=>this.requestStatusString(d,p)))}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"),c2))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${c2} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){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>Ys&&(l=this._parseStack.position+Ys)}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<Ys&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ys))),a||this._dirtyRowTracker.clearRange(),e.length>Ys)for(let d=l;d<e.length;d+=Ys){let p=d+Ys<e.length?d+Ys:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,s,m,d),this._logSlowResolvingAsync(n),n}else if(!a){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,l=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(r=e[y],r<127&&l){let k=l[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=Xo.extractWidth(S);let w=Xo.extractShouldJoin(S),C=w?Xo.extractWidth(_):0;if(_=S,a&&this._onA11yChar.fire(to(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=m,T=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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&m instanceof au&&m.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=u-1,s===2)continue}if(w&&this._activeBuffer.x){let k=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let T=s-C;--T>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(d&&(m.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(p)),m.getWidth(u-1)===2&&m.setCellFromCodepoint(u-1,0,1,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,s,p),s>0)for(;--s;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>a2(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new s2(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new br(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 l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(l.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(en));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=Xo.extractWidth(t),s=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(l.length*n),u=0;for(let d=0;d<l.length;){let p=l.codePointAt(d)||0;a[u++]=p,d+=p>65535?2:1}let h=u;for(let d=1;d<n;++d)a.copyWithin(h,0,u),h+=u;return this.print(a,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(me.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(me.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(me.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(me.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(me.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,qo),this._charsetService.setgCharset(1,qo),this._charsetService.setgCharset(2,qo),this._charsetService.setgCharset(3,qo);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){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:l}=this._coreMouseService,a=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:p}=u,m=this._optionsService.rawOptions,_=(w,C)=>(a.triggerDataEvent(`${me.ESC}[${t?"":"?"}${w};${C}$y`),!0),y=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,y(a.modes.insertMode)):S===12?_(S,3):S===20?_(S,y(m.convertEol)):_(S,0):S===1?_(S,y(r.applicationCursorKeys)):S===3?_(S,m.windowOptions.setWinLines?h===80?2:h===132?1:0:0):S===6?_(S,y(r.origin)):S===7?_(S,y(r.wraparound)):S===8?_(S,3):S===9?_(S,y(s==="X10")):S===12?_(S,y(m.cursorBlink)):S===25?_(S,y(!a.isCursorHidden)):S===45?_(S,y(r.reverseWraparound)):S===66?_(S,y(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,y(s==="VT200")):S===1002?_(S,y(s==="DRAG")):S===1003?_(S,y(s==="ANY")):S===1004?_(S,y(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,y(l==="SGR")):S===1015?_(S,4):S===1016?_(S,y(l==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,y(d===p)):S===2004?_(S,y(r.bracketedPasteMode)):S===2026?_(S,y(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=ed.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,l=0;do{if(r[l+s]=e.params[t+l],e.hasSubParams(t+l)){let a=e.getSubParams(t+l),u=0;do r[1]===5&&(s=1),r[l+u+1+s]=a[u];while(++u<a.length&&u+l+1+s<r.length);break}if(r[1]===5&&l+s>=2||r[1]===2&&l+s>=5)break;r[1]&&(s=1)}while(++l+t<e.length&&l+s<r.length);for(let a=2;a<r.length;++a)r[a]===-1&&(r[a]=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 l}_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=en.fg,e.bg=en.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|=en.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=en.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|=en.fg&16777215,r.bg&=-67108864,r.bg|=en.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${me.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${me.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(`${me.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=en.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(!a2(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(`${me.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>l2&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>l2&&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 l=parseInt(r);if(d2(l))if(s==="?")t.push({type:0,index:l});else{let a=o2(s);a&&t.push({type:1,index:l,color:a})}}}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(l=>l.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=o2(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]);d2(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,qo),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(JW[e[0]],dn[e[1]]||qo),!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=en.clone(),this._eraseAttrDataInternal=en.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 Vr;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=a=>(this._coreService.triggerDataEvent(`${me.ESC}${a}${me.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)}},by=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&&(u2=e,e=t,t=u2),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};by=Wt([Ee(0,Kn)],by);function d2(e){return 0<=e&&e<256}var tV=5e7,h2=12,nV=50,rV=class extends Ge{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 xe),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>tV)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 a=u=>performance.now()-n>=h2?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=h2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>nV&&(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()}},xy=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 l=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.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)))}};xy=Wt([Ee(0,Kn)],xy);var f2=!1,iV=class extends Ge{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ta),this._onBinary=this._register(new xe),this.onBinary=this._onBinary.event,this._onData=this._register(new xe),this.onData=this._onData.event,this._onLineFeed=this._register(new xe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new xe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new xe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new xe),this._instantiationService=new TW,this.optionsService=this._register(new BW(e)),this._instantiationService.setService(Gn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(gy)),this._instantiationService.setService(Kn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(my)),this._instantiationService.setService(WN,this._logService),this.coreService=this._register(this._instantiationService.createInstance(vy)),this._instantiationService.setService(pl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(_y)),this._instantiationService.setService($N,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Xo)),this._instantiationService.setService(CU,this.unicodeService),this._charsetService=this._instantiationService.createInstance($W),this._instantiationService.setService(wU,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(xy),this._instantiationService.setService(VN,this._oscLinkService),this._inputHandler=this._register(new eV(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(An.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(An.forward(this._bufferService.onResize,this._onResize)),this._register(An.forward(this.coreService.onData,this._onData)),this._register(An.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 rV((t,n)=>this._inputHandler.parse(t,n))),this._register(An.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new xe),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&&!f2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),f2=!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,wA),t=Math.max(t,CA),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(i2.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(i2(this._bufferService),!1))),this._windowsWrappingHeuristics.value=jt(()=>{for(let t of e)t.dispose()})}}},sV={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 oV(e,t,n,r){var a;let s={type:0,cancel:!1,key:void 0},l=(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=me.ESC+"OA":s.key=me.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=me.ESC+"OD":s.key=me.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=me.ESC+"OC":s.key=me.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=me.ESC+"OB":s.key=me.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":me.DEL,e.altKey&&(s.key=me.ESC+s.key);break;case 9:if(e.shiftKey){s.key=me.ESC+"[Z";break}s.key=me.HT,s.cancel=!0;break;case 13:s.key=e.altKey?me.ESC+me.CR:me.CR,s.cancel=!0;break;case 27:s.key=me.ESC,e.altKey&&(s.key=me.ESC+me.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"D":t?s.key=me.ESC+"OD":s.key=me.ESC+"[D";break;case 39:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"C":t?s.key=me.ESC+"OC":s.key=me.ESC+"[C";break;case 38:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"A":t?s.key=me.ESC+"OA":s.key=me.ESC+"[A";break;case 40:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"B":t?s.key=me.ESC+"OB":s.key=me.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=me.ESC+"[2~");break;case 46:l?s.key=me.ESC+"[3;"+(l+1)+"~":s.key=me.ESC+"[3~";break;case 36:l?s.key=me.ESC+"[1;"+(l+1)+"H":t?s.key=me.ESC+"OH":s.key=me.ESC+"[H";break;case 35:l?s.key=me.ESC+"[1;"+(l+1)+"F":t?s.key=me.ESC+"OF":s.key=me.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=me.ESC+"[5;"+(l+1)+"~":s.key=me.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=me.ESC+"[6;"+(l+1)+"~":s.key=me.ESC+"[6~";break;case 112:l?s.key=me.ESC+"[1;"+(l+1)+"P":s.key=me.ESC+"OP";break;case 113:l?s.key=me.ESC+"[1;"+(l+1)+"Q":s.key=me.ESC+"OQ";break;case 114:l?s.key=me.ESC+"[1;"+(l+1)+"R":s.key=me.ESC+"OR";break;case 115:l?s.key=me.ESC+"[1;"+(l+1)+"S":s.key=me.ESC+"OS";break;case 116:l?s.key=me.ESC+"[15;"+(l+1)+"~":s.key=me.ESC+"[15~";break;case 117:l?s.key=me.ESC+"[17;"+(l+1)+"~":s.key=me.ESC+"[17~";break;case 118:l?s.key=me.ESC+"[18;"+(l+1)+"~":s.key=me.ESC+"[18~";break;case 119:l?s.key=me.ESC+"[19;"+(l+1)+"~":s.key=me.ESC+"[19~";break;case 120:l?s.key=me.ESC+"[20;"+(l+1)+"~":s.key=me.ESC+"[20~";break;case 121:l?s.key=me.ESC+"[21;"+(l+1)+"~":s.key=me.ESC+"[21~";break;case 122:l?s.key=me.ESC+"[23;"+(l+1)+"~":s.key=me.ESC+"[23~";break;case 123:l?s.key=me.ESC+"[24;"+(l+1)+"~":s.key=me.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=me.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=me.DEL:e.keyCode===219?s.key=me.ESC:e.keyCode===220?s.key=me.FS:e.keyCode===221&&(s.key=me.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(a=sV[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(u)s.key=me.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=me.ESC+d}else if(e.keyCode===32)s.key=me.ESC+(e.ctrlKey?me.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=me.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=me.US),e.key==="@"&&(s.key=me.NUL));break}return s}var Kt=0,lV=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Uf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Uf,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,l)=>this._getKey(s)-this._getKey(l)),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||(Kt=this._search(t),Kt===-1)||this._getKey(this._array[Kt])!==t)return!1;do if(this._array[Kt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Kt),!0;while(++Kt<this._array.length&&this._getKey(this._array[Kt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,l)=>s-l),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&&(Kt=this._search(e),!(Kt<0||Kt>=this._array.length)&&this._getKey(this._array[Kt])===e))do yield this._array[Kt];while(++Kt<this._array.length&&this._getKey(this._array[Kt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Kt=this._search(e),!(Kt<0||Kt>=this._array.length)&&this._getKey(this._array[Kt])===e))do t(this._array[Kt]);while(++Kt<this._array.length&&this._getKey(this._array[Kt])===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}},Bv=0,p2=0,aV=class extends Ge{constructor(){super(),this._decorations=new lV(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new xe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new xe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(jt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new cV(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 l of this._decorations.getKeyIterator(t))r=l.options.x??0,s=r+(l.options.width??1),e>=r&&e<s&&(!n||(l.options.layer??"bottom")===n)&&(yield l)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{Bv=s.options.x??0,p2=Bv+(s.options.width??1),e>=Bv&&e<p2&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},cV=class extends lo{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new xe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new xe),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=It.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=It.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},uV=1e3,dV=class{constructor(e,t=uV){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,l=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_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)}},m2=20,$f=class extends Ge{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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,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 dV(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(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
500
|
+
`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(He(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(jt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<m2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
501
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===m2+1&&(this._liveRegion.textContent+=F_.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 l=n.lines.get(n.ydisp+s),a=[],u=(l==null?void 0:l.translateToString(!0,void 0,void 0,a))||"",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,a)),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"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===l||e.relatedTarget!==r)return;let a,u;if(t===0?(a=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(a=this._rowElements.shift(),u=n,this._rowContainer.removeChild(a)),a.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 p=h instanceof Text?h.parentNode:h,m=parseInt(p==null?void 0:p.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(p);if(!_)return console.warn("columns is null. Race condition?"),null;let y=d<_.length?_[d]:_.slice(-1)[0]+1;return y>=this._terminal.cols&&(++m,y=0),{row:m,column:y}},l=s(t),a=s(n);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.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,l;e.style.transform="";let t=e.getBoundingClientRect().width,n=(l=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:l[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};$f=Wt([Ee(1,o0),Ee(2,vs),Ee(3,_s)],$f);var Sy=class extends Ge{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 xe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new xe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(jt(()=>{var l;il(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(He(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(He(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(He(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(He(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(l=>{l==null||l.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,a]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):a.provideLinks(e.y,u=>{var d,p;if(this._isMouseOut)return;let h=u==null?void 0:u.map(m=>({link:m}));(d=this._activeProviderReplies)==null||d.set(l,h),n=this._checkLinkProviderResult(l,e,n),((p=this._activeProviderReplies)==null?void 0:p.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 l=0;l<s.length;l++){let a=s[l],u=a.link.range.start.y<e?0:a.link.range.start.x,h=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(l--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var l;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(s=!0);if(!s&&r){let a=r.find(u=>this._linkAtPosition(u.link,t));a&&(n=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let a=0;a<this._activeProviderReplies.size;a++){let u=(l=this._activeProviderReplies.get(a))==null?void 0:l.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&&hV(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,il(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,l;(r=this._currentLink)!=null&&r.state&&((l=(s=this._currentLink)==null?void 0:s.state)==null?void 0:l.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 l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!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}}};Sy=Wt([Ee(1,l0),Ee(2,_s),Ee(3,Kn),Ee(4,KN)],Sy);function hV(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 fV=class extends iV{constructor(e={}){super(e),this._linkifier=this._register(new Ta),this.browser=hA,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ta),this._onCursorMove=this._register(new xe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new xe),this.onKey=this._onKey.event,this._onRender=this._register(new xe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new xe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new xe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new xe),this.onBell=this._onBell.event,this._onFocus=this._register(new xe),this._onBlur=this._register(new xe),this._onA11yCharEmitter=this._register(new xe),this._onA11yTabEmitter=this._register(new xe),this._onWillOpen=this._register(new xe),this._setup(),this._decorationService=this._instantiationService.createInstance(aV),this._instantiationService.setService(td,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(nW),this._instantiationService.setService(KN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance($_)),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(An.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(An.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(An.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(An.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(jt(()=>{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=Nt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${me.ESC}]${r};${QW(s)}${uA.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=tn.toColor(...t.color));else{let l=n;this._themeService.modifyColors(a=>a[l]=tn.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($f,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(me.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(me.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),l=this._renderService.dimensions.css.cell.width*s,a=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=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(He(this.element,"copy",t=>{this.hasSelection()&&vU(t,this._selectionService)}));let e=t=>_U(t,this.textarea,this.coreService,this.optionsService);this._register(He(this.textarea,"paste",e)),this._register(He(this.element,"paste",e)),fA?this._register(He(this.element,"mousedown",t=>{t.button===2&&kk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(He(this.element,"contextmenu",t=>{kk(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),m0&&this._register(He(this.element,"auxclick",t=>{t.button===1&&BN(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(He(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(He(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(He(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(He(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(He(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(He(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(He(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(He(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),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",H_.get()),gA||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(eW,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(vs,this._coreBrowserService),this._register(He(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(He(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(uy,this._document,this._helperContainer),this._instantiationService.setService(Rp,this._charSizeService),this._themeService=this._instantiationService.createInstance(py),this._instantiationService.setService(Wa,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Hf),this._instantiationService.setService(qN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(hy,this.rows,this.screenElement)),this._instantiationService.setService(_s,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ly,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(dy),this._instantiationService.setService(l0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Sy,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(sy,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(fy,this.element,this.screenElement,r)),this._instantiationService.setService(EU,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(An.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(oy,this.screenElement)),this._register(He(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),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($f,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(If,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(If,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(cy,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(l){var d,p,m,_,y;let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let u,h;switch(l.overrideType||l.type){case"mousemove":h=32,l.buttons===void 0?(u=3,l.button!==void 0&&(u=l.button<3?l.button:3)):u=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":h=0,u=l.button<3?l.button:3;break;case"mousedown":h=1,u=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let S=l.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(l,(_=(m=(p=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:p.device)==null?void 0:m.cell)==null?void 0:_.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;h=S<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:u,action:h,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:l=>(n(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(n(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&n(l)},mousemove:l=>{l.buttons||n(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(He(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return n(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(He(t,"wheel",l=>{var a,u,h,d,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(d=(h=(u=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(l,!0);let m=me.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(l,!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){PN(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=oV(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===me.ETX||n.key===me.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)&&(pV(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(en));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(me.ESC+"[I"):this.coreService.triggerDataEvent(me.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(`${me.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(`${me.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function pV(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var mV=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)}},gV=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 Vr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},g2=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 gV(t)}getNullCell(){return new Vr}},vV=class extends Ge{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new xe),this.onBufferChange=this._onBufferChange.event,this._normal=new g2(this._core.buffers.normal,"normal"),this._alternate=new g2(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)}},_V=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)}},yV=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}},bV=["cols","rows"],vi=0,xV=class extends Ge{constructor(e){super(),this._core=this._register(new fV(e)),this._addonManager=this._register(new mV),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(bV.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 _V(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new yV(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 vV(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
|
|
502
|
+
`,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 H_.get()},set promptLabel(e){H_.set(e)},get tooMuchOutput(){return F_.get()},set tooMuchOutput(e){F_.set(e)}}}_verifyIntegers(...e){for(vi of e)if(vi===1/0||isNaN(vi)||vi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(vi of e)if(vi&&(vi===1/0||isNaN(vi)||vi%1!==0||vi<0))throw new Error("This API only accepts positive integers")}};const EA="lever-theme",RA=b.createContext(void 0),SV=e=>e==="light"||e==="dark"||e==="system",TA=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",v2=e=>{if(typeof document>"u")return;const t=e==="system"?TA():e;document.documentElement.classList.toggle("dark",t==="dark")},wV=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(EA);return SV(e)?e:"system"};function CV({children:e}){const[t,n]=b.useState(wV);b.useEffect(()=>{v2(t),typeof window<"u"&&window.localStorage.setItem(EA,t)},[t]),b.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>v2("system");return s.addEventListener?(s.addEventListener("change",l),()=>s.removeEventListener("change",l)):(s.addListener(l),()=>s.removeListener(l))},[t]);const r=b.useMemo(()=>{const s=t==="system"?TA():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return g.jsx(RA.Provider,{value:r,children:e})}function MA(){const e=b.useContext(RA);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const kV={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"},EV={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 NA(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function AA(e,t){var S,w,C,k,T;const n=e.element,r=(k=(C=(w=(S=e._core)==null?void 0:S._renderService)==null?void 0:w.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,l=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(l)||s<=0||l<=0)return null;const a=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((T=e.options.overviewRuler)==null?void 0:T.width)??14,p=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),m=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),_=Math.max(0,a.width-p-d-1),y=Math.max(0,a.height-m);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(y/l))}}function $h(e){e.refresh(0,Math.max(0,e.rows-1))}function Wh(e,t,n,r,s){const l=AA(e,t)??NA(e);return n.current&&n.current.cols===l.cols&&n.current.rows===l.rows||(e.resize(l.cols,l.rows),n.current=l,r&&s(l.cols,l.rows)),l}function RV({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:l=0,focusRequestVersion:a=0,onPathChange:u}){const{resolvedTheme:h}=MA(),d=b.useRef(null),p=b.useRef(null),m=b.useRef(null),_=b.useRef(!1),y=b.useRef(0),S=b.useRef(null),w=b.useRef(null),[C,k]=b.useState(null),[T,R]=b.useState(null),M=h==="dark"?EV:kV,O=(j,F)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:F}).catch(()=>{})},D=()=>{const j=()=>{const F=p.current,G=d.current;!F||!G||!_.current||Wh(F,G,w,!0,O)};requestAnimationFrame(()=>{j(),setTimeout(j,0)})};return b.useEffect(()=>{const j=new xV({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:M}),F=new sU;j.loadAddon(F),j.loadAddon(new hU),p.current=j;const G=d.current;G&&(j.open(G),m.current&&j.write(m.current),Wh(j,G,w,!1,()=>{}),$h(j),D());const P=j.onData($=>{n.command({type:"terminal.input",terminalId:t,data:$}).catch(U=>{R(U instanceof Error?U.message:String(U))})}),W=j.onResize(({cols:$,rows:U})=>{if(!_.current)return;const H={cols:$,rows:U};w.current&&w.current.cols===$&&w.current.rows===U||(w.current=H,O($,U))}),I=new ResizeObserver(()=>{const $=p.current,U=d.current;!$||!U||Wh($,U,w,_.current,(H,B)=>{n.command({type:"terminal.resize",terminalId:t,cols:H,rows:B}).catch(()=>{})})});return G&&I.observe(G),()=>{I.disconnect(),W.dispose(),P.dispose(),m.current=F.serialize(),j.dispose(),p.current=null}},[r,n,t,M]),b.useEffect(()=>{const j=p.current;j&&(j.options.scrollback=r)},[r]),b.useEffect(()=>{const j=p.current;j&&(j.options.theme=M,$h(j))},[M]),b.useEffect(()=>{if(a===0)return;const j=p.current;j&&requestAnimationFrame(()=>{j.focus()})},[a]),b.useEffect(()=>{if(l===0)return;const j=p.current;j&&(_.current=!1,y.current+=1,S.current=null,m.current=null,k(null),R(null),j.reset(),$h(j),n.command({type:"terminal.close",terminalId:t}).catch(F=>{R(F instanceof Error?F.message:String(F))}))},[l,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=P=>{const W=p.current;if(!W)return;const I=JSON.stringify({cwd:P.cwd,shell:P.shell,cols:P.cols,rows:P.rows,scrollback:P.scrollback,status:P.status,exitCode:P.exitCode,serializedState:P.serializedState});if(S.current===I){k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),m.current=P.serializedState||null;return}S.current=I,k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),m.current=P.serializedState||null,W.options.scrollback=P.scrollback,W.reset(),P.serializedState&&W.write(P.serializedState),$h(W)},F=()=>{const P=p.current,W=d.current;if(!P||!W)return;const I=AA(P,W)??NA(P);P.resize(I.cols,I.rows),w.current=I,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:I.cols,rows:I.rows,scrollback:r}).then($=>{_.current=!0,R(null),$&&j($),D()}).catch($=>{R($ instanceof Error?$.message:String($))})},G=()=>{const P=++y.current,W=()=>{if(y.current!==P)return;const I=p.current,$=d.current;if(!I||!$)return;Wh(I,$,w,!1,()=>{});const U=$.getBoundingClientRect();if(U.width<=0||U.height<=0){requestAnimationFrame(W);return}F()};requestAnimationFrame(()=>{requestAnimationFrame(W)})};return G(),n.subscribeTerminal(t,{onSnapshot:P=>{if(!P){_.current=!1,S.current=null,s==="connected"&&G();return}_.current=!0,R(null),j(P),D()},onEvent:P=>{const W=p.current;if(W){if(P.type==="terminal.output"){W.write(P.data);return}P.type==="terminal.exit"&&k(I=>({cwd:(I==null?void 0:I.cwd)??"",shell:(I==null?void 0:I.shell)??"",status:"exited",exitCode:P.exitCode}))}}})},[s,e,r,n,t]),g.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[g.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:g.jsx("div",{ref:d,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),T?g.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",T]}):null]})}const TV=24;function DA(e){return e+TV}function MV(e,t){return Math.max(1,e)*DA(t)}function _2({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:l,focusRequestVersion:a=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:p}){const m=b.useRef(null),_=b.useRef({}),y=b.useRef([]),[S,w]=b.useState(0),[C,k]=b.useState({}),[T,R]=b.useState({});b.useLayoutEffect(()=>{const G=m.current;if(!G)return;const P=()=>{w(G.getBoundingClientRect().width)},W=new ResizeObserver(P);return W.observe(G),P(),()=>W.disconnect()},[]);const M=t.terminals.length,O=DA(l),D=MV(M,l),j=Math.max(S,D),F=b.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return b.useLayoutEffect(()=>{const G=y.current,P=t.terminals.map($=>$.id),W=P.find($=>!G.includes($));if(y.current=P,!W||G.length===0)return;const I=_.current[W];I&&I.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),g.jsx("div",{className:"flex h-full min-h-0 flex-col",children:g.jsx("div",{ref:m,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:g.jsx("div",{className:"h-full min-h-0",style:{width:j||"100%"},children:g.jsx(of,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>p(e,t.terminals.map(P=>G[P.id]??P.size)),children:t.terminals.map((G,P)=>g.jsxs(b.Fragment,{children:[g.jsx(Wo,{id:G.id,defaultSize:`${G.size}%`,minSize:`${O}px`,className:"min-h-0 overflow-hidden",style:{minWidth:O},children:g.jsxs("div",{ref:W=>{_.current[G.id]=W},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:O},children:[g.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[g.jsx("div",{className:"min-w-0 flex-1 text-left",children:g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),g.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[G.id]??""})]})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>R(W=>({...W,[G.id]:(W[G.id]??0)+1})),children:g.jsx(tP,{className:"size-3.5"})}),g.jsxs(nu,{children:[g.jsx(ru,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,G.id),children:g.jsx(fb,{className:"size-3.5"})})}),g.jsx(ha,{side:"bottom",shortcut:u})]}),g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,G.id),children:g.jsx(za,{className:"size-3.5"})})]})]}),g.jsx(RV,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:T[G.id]??0,focusRequestVersion:P===0?a:0,onPathChange:W=>k(I=>I[G.id]===W?I:{...I,[G.id]:W})})]})}),P<t.terminals.length-1?g.jsx(lf,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},F)})})})}function y2(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function NV(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:y2(n.groups.line),column:y2(n.groups.column)}:{path:t}}function Iv(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 g0=()=>{},OA=b.createContext(g0);function AV({children:e,onOpenLocalLink:t}){return g.jsx(OA.Provider,{value:t??g0,children:e})}const wy={Task:Sf,TaskOutput:Sf,Bash:mb,Glob:gv,Grep:gv,ExitPlanMode:xC,Read:lP,Edit:rP,Write:sP,NotebookEdit:nT,WebFetch:v6,TodoWrite:O6,WebSearch:gv,KillShell:XP,AskUserQuestion:eT,Skill:rT,EnterPlanMode:xC},LA=tB;function jA(e){return wy[e]?wy[e]:LA}function go({children:e,className:t}){return g.jsx("div",{className:ye("flex gap-3 justify-start items-center",t),children:e})}function DV({children:e,className:t}){return g.jsx("div",{className:ye("flex items-center gap-1.5 text-xs",t),children:e})}function ho({children:e,className:t}){return g.jsx("span",{className:ye("font-medium text-foreground/80",t),children:e})}function OV({children:e}){return g.jsx("span",{className:"text-muted-foreground",children:e})}function Np({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=b.useState(n);return g.jsxs("div",{className:"flex flex-col w-full",children:[g.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:[g.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),g.jsx(ds,{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 b2({label:e,children:t,copyText:n}){const[r,s]=b.useState(!1),l=n??Wf(t),a=b.useCallback(async()=>{await navigator.clipboard.writeText(l),s(!0),setTimeout(()=>s(!1),2e3)},[l]);return g.jsxs("div",{children:[g.jsx("span",{className:"font-medium text-muted-foreground",children:e}),g.jsxs("div",{className:"relative group/codeblock",children:[g.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}),g.jsx(rt,{variant:"ghost",size:"icon",className:ye("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:a,children:r?g.jsx(ao,{className:"h-3.5 w-3.5 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})]})]})}function zA({children:e,icon:t,className:n}){return g.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&g.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function Ap({children:e,className:t}){return g.jsxs("div",{className:ye("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[g.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:g.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),g.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function Wf(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Wf).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Wf(t.children)}return""}function x2(e,t){return b.isValidElement(e)?b.cloneElement(e,{className:ye(e.props.className,t)}):e}const v0={h1:({children:e})=>g.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>g.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>g.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>g.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>g.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>g.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=Wf(e),l=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return g.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[g.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),g.jsx(rt,{variant:"ghost",size:"icon",className:ye("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:l,children:n?g.jsx(ao,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?g.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):g.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})=>g.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:g.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>g.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>g.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})=>g.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>g.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]=x2(r,"mt-0"));const s=n.length-1,l=n[s];return l!==void 0&&(n[s]=x2(l,"mb-0")),g.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})=>g.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 Dp(e){return{...v0,a:({children:t,href:n,onClick:r,...s})=>{const l=b.useContext(OA),a=NV(n);return g.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:a?void 0:"_blank",rel:a?void 0:"noopener noreferrer",onClick:u=>{r==null||r(u),!(u.defaultPrevented||!a||l===g0)&&(u.preventDefault(),l(a))},...s,children:t})}}}({...v0});const LV={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function jV({status:e}){const t=(e?LV[e]:void 0)||"Processing...",n=e==="failed";return g.jsx(go,{className:"ml-[1px]",children:g.jsxs(DV,{children:[n?g.jsx(za,{className:"size-4.5 text-red-500"}):g.jsx(Mi,{className:"size-4.5 animate-spin text-muted-icon"}),g.jsx(_p,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const PA=b.forwardRef(({className:e,children:t,...n},r)=>g.jsx("div",{ref:r,className:ye("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));PA.displayName="ScrollArea";const BA={toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Hv(e){return(e??[]).join(", ")}function Xc(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const zV=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function PV(e,t){const n=BV(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 Zc(e,t,n){return((e==null?void 0:e.bindings[t])??no[t]).some(s=>PV(s,n))}function IA(e){return{bindings:{toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??no.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??no.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??no.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??no.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??no.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function BV(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(),l=zV.get(s);if(l==="ctrl"){n.ctrl=!0;continue}if(l==="meta"){n.meta=!0;continue}if(l==="alt"){n.alt=!0;continue}if(l==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}const Op=20,Cy=50,HA=30;function FA(e){return Number.isFinite(e)?Math.min(Cy,Math.max(Op,e)):HA}function IV(){return{isVisible:!1,size:Op}}function Fv(e,t){return e[t]??IV()}function HV(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:FA(s.size??HA)}]))}}const gf=Ua()($a(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...Fv(n.projects,t),isVisible:!Fv(n.projects,t).isVisible}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Fv(r.projects,t),size:FA(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:HV})),FV={isVisible:!1,size:Op},_0=[68,32];function UV(){return{isVisible:!1,mainSizes:[..._0],terminals:[],nextTerminalIndex:0}}function $V(e,t){return e[t]??UV()}function Uv(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 WV(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 VV(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function la(e,t,n){return{...e,[t]:n($V(e,t))}}const Js=Ua()($a(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:la(r.projects,t,s=>{var h,d;const l=VV(s.terminals),a={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:WV(s.nextTerminalIndex),size:100/(l.length+1)},u=n?Math.max(l.findIndex(p=>p.id===n)+1,0):l.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...l.slice(0,u),a,...l.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:la(r.projects,t,s=>{const l=s.terminals.filter(u=>u.id!==n);if(l.length===0)return{...s,isVisible:!1,terminals:[]};const a=Uv(l.map(u=>u.size));return{...s,terminals:l.map((u,h)=>({...u,size:a[h]??100/l.length}))}})})),toggleVisibility:t=>e(n=>({projects:la(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:la(n.projects,t,r=>({...r,mainSizes:[..._0]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=Uv(n);return{projects:la(r.projects,t,l=>({...l,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:la(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const l=Uv(n);return{...s,terminals:s.terminals.map((a,u)=>({...a,size:l[u]??a.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),qV={isVisible:!1,mainSizes:[..._0],terminals:[],nextTerminalIndex:0},Vf=1e3,ky=500,Ey=5e3,qf=450,Ry=250,Ty=900,My="cursor";function Ny(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 KV(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function S2(e){return Number.isFinite(e)?Math.min(Ey,Math.max(ky,Math.round(e))):Vf}function w2(e){return Number.isFinite(e)?Math.min(Ty,Math.max(Ry,Math.round(e))):qf}function C2(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return My}}function $v(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:Ny(t)}const Hr=Ua()($a(e=>({scrollbackLines:Vf,minColumnWidth:qf,editorPreset:My,editorCommandTemplate:Ny(My),setScrollbackLines:t=>e({scrollbackLines:S2(t)}),setMinColumnWidth:t=>e({minColumnWidth:w2(t)}),setEditorPreset:t=>e(n=>{const r=C2(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?$v(n.editorCommandTemplate,r):Ny(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:$v(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=C2(t==null?void 0:t.editorPreset);return{scrollbackLines:S2((t==null?void 0:t.scrollbackLines)??Vf),minColumnWidth:w2((t==null?void 0:t.minColumnWidth)??qf),editorPreset:n,editorCommandTemplate:$v(t==null?void 0:t.editorCommandTemplate,n)}}})),GV=35;function YV(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function XV(e,t){const n=YV(e,t);return n>=0&&n<GV}const ma=350,ZV=[.4,0,.2,1],QV=8,k2=1e-6;function JV(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function eq(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function tq(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function nq(e,t,n){let r=e;for(let s=0;s<QV;s+=1){const l=JV(r,t,n)-e;if(Math.abs(l)<k2)return r;const a=tq(r,t,n);if(Math.abs(a)<k2)break;r-=l/a}return r}function rq(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=ZV,l=nq(e,t,r);return eq(l,n,s)}function UA(e,t,n){const r=rq(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function iq({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=b.useRef(null),l=b.useRef(null),a=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(!1),p=b.useRef(null),m=b.useRef(!1),_=b.useRef(!1);return b.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),b.useLayoutEffect(()=>{var j,F,G,P,W,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 S=p.current,w=S!==null&&S!==e,C=n&&!_.current,k=!m.current,T=n?[100-r,r]:[100,0],R=w||k&&n,M=C||k?[100,0]:[y.getLayout().workspace??T[0],y.getLayout().rightSidebar??T[1]];if(p.current=e,m.current=t,_.current=n,R||Math.abs(M[0]-T[0])<.1&&Math.abs(M[1]-T[1])<.1){y.setLayout({workspace:T[0],rightSidebar:T[1]}),(j=l.current)==null||j.setAttribute("data-right-sidebar-open",n?"true":"false"),(F=a.current)==null||F.setAttribute("data-right-sidebar-open",n?"true":"false"),(G=a.current)==null||G.setAttribute("data-right-sidebar-animated","false");return}d.current=!0,(P=l.current)==null||P.setAttribute("data-right-sidebar-open",n?"true":"false"),(W=a.current)==null||W.setAttribute("data-right-sidebar-open",n?"true":"false"),(I=a.current)==null||I.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:M[0],rightSidebar:M[1]});const O=performance.now(),D=$=>{const U=Math.min(1,($-O)/ma),H=UA(M,T,U);if(y.setLayout({workspace:H[0],rightSidebar:H[1]}),U<1){u.current=window.requestAnimationFrame(D);return}y.setLayout({workspace:T[0],rightSidebar:T[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||(m.current=!1,_.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:l,sidebarVisualRef:a}}function sq(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 oq({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:l,liveLayout:a}){const u=e!==null&&e!==t,h=s&&!r,d=!n,p=e===null&&t!==null,m=s?l.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:a,shouldSkipAnimation:u||p&&d,targetLayout:m}}function lq({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const l=b.useRef(null),a=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(null),p=b.useRef(!1),m=b.useRef(null),_=b.useRef(!1),y=b.useRef(!1),S=b.useRef(!1),[w,C]=b.useState(0);return b.useEffect(()=>{var R;const k=m.current,T=S.current;sq({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:T})&&C(M=>M+1),k!==null&&k===t&&!r&&T&&((R=e.current)==null||R.focus({preventScroll:!0})),S.current=r,m.current=t},[e,t,r]),b.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),b.useLayoutEffect(()=>{var F,G,P,W,I,$;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),p.current=!1;return}const k=l.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 T=m.current,{currentLayout:R,shouldSkipAnimation:M,targetLayout:O}=oq({previousProjectId:T,projectId:t,previousShouldRenderTerminalLayout:_.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(_.current=n,y.current=r,M||Math.abs(R[0]-O[0])<.1&&Math.abs(R[1]-O[1])<.1){k.setLayout({chat:O[0],terminal:O[1]}),(F=a.current)==null||F.setAttribute("data-terminal-open",r?"true":"false"),(G=u.current)==null||G.setAttribute("data-terminal-open",r?"true":"false"),(P=u.current)==null||P.setAttribute("data-terminal-animated","false");return}p.current=!0,(W=a.current)==null||W.setAttribute("data-terminal-open",r?"true":"false"),(I=u.current)==null||I.setAttribute("data-terminal-open",r?"true":"false"),($=u.current)==null||$.setAttribute("data-terminal-animated","true"),k.setLayout({chat:R[0],terminal:R[1]});const D=performance.now(),j=U=>{const H=Math.min(1,(U-D)/ma),B=UA(R,O,H);if(k.setLayout({chat:B[0],terminal:B[1]}),H<1){h.current=window.requestAnimationFrame(j);return}k.setLayout({chat:O[0],terminal:O[1]}),h.current=null,d.current=window.setTimeout(()=>{p.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(j)},[t,n,r,s.mainSizes]),b.useEffect(()=>{n||(_.current=!1,y.current=!1)},[n]),{isAnimating:p,mainPanelGroupRef:l,terminalFocusRequestVersion:w,terminalPanelRef:a,terminalVisualRef:u}}function aq(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dq={};function E2(e,t){return(dq.jsx?uq:cq).test(e)}const hq=/[ \t\n\f\r]/g;function fq(e){return typeof e=="object"?e.type==="text"?R2(e.value):!1:R2(e)}function R2(e){return e.replace(hq,"")===""}class id{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}id.prototype.normal={};id.prototype.property={};id.prototype.space=void 0;function $A(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new id(n,r,t)}function Ay(e){return e.toLowerCase()}class ar{constructor(t,n){this.attribute=n,this.property=t}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let pq=0;const Ve=ml(),Jt=ml(),Dy=ml(),be=ml(),kt=ml(),Sa=ml(),xr=ml();function ml(){return 2**++pq}const Oy=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Jt,commaOrSpaceSeparated:xr,commaSeparated:Sa,number:be,overloadedBoolean:Dy,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),Wv=Object.keys(Oy);class y0 extends ar{constructor(t,n,r,s){let l=-1;if(super(t,n),T2(this,"space",s),typeof r=="number")for(;++l<Wv.length;){const a=Wv[l];T2(this,Wv[l],(r&Oy[a])===Oy[a])}}}y0.prototype.defined=!0;function T2(e,t,n){n&&(e[t]=n)}function qa(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new y0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Ay(r)]=r,n[Ay(l.attribute)]=r}return new id(t,n,e.space)}const WA=qa({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:kt,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:be,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:kt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Jt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function VA(e,t){return t in e?e[t]:t}function qA(e,t){return VA(e,t.toLowerCase())}const mq=qa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Sa,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:kt,autoFocus:Ve,autoPlay:Ve,blocking:kt,capture:null,charSet:null,checked:Ve,cite:null,className:kt,cols:be,colSpan:null,content:null,contentEditable:Jt,controls:Ve,controlsList:kt,coords:be|Sa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Dy,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:kt,height:be,hidden:Dy,high:be,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ve,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:be,pattern:null,ping:kt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:kt,required:Ve,reversed:Ve,rows:be,rowSpan:be,sandbox:kt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Jt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:qA}),gq=qa({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:xr,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:kt,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:Sa,g2:Sa,glyphName:Sa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,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:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:VA}),KA=qa({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()}}),GA=qa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qA}),YA=qa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vq={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"},_q=/[A-Z]/g,M2=/-[a-z]/g,yq=/^data[-\w.:]+$/i;function bq(e,t){const n=Ay(t);let r=t,s=ar;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yq.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(M2,Sq);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!M2.test(l)){let a=l.replace(_q,xq);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=y0}return new s(r,t)}function xq(e){return"-"+e.toLowerCase()}function Sq(e){return e.charAt(1).toUpperCase()}const wq=$A([WA,mq,KA,GA,YA],"html"),b0=$A([WA,gq,KA,GA,YA],"svg");function Cq(e){return e.join(" ").trim()}var aa={},Vv,N2;function kq(){if(N2)return Vv;N2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
503
|
+
`,d="/",p="*",m="",_="comment",y="declaration";function S(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var T=1,R=1;function M(U){var H=U.match(t);H&&(T+=H.length);var B=U.lastIndexOf(h);R=~B?U.length-B:R+U.length}function O(){var U={line:T,column:R};return function(H){return H.position=new D(U),G(),H}}function D(U){this.start=U,this.end={line:T,column:R},this.source=k.source}D.prototype.content=C;function j(U){var H=new Error(k.source+":"+T+":"+R+": "+U);if(H.reason=U,H.filename=k.source,H.line=T,H.column=R,H.source=C,!k.silent)throw H}function F(U){var H=U.exec(C);if(H){var B=H[0];return M(B),C=C.slice(B.length),H}}function G(){F(n)}function P(U){var H;for(U=U||[];H=W();)H!==!1&&U.push(H);return U}function W(){var U=O();if(!(d!=C.charAt(0)||p!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(p!=C.charAt(H)||d!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return j("End of comment missing");var B=C.slice(2,H-2);return R+=2,M(B),C=C.slice(H),R+=2,U({type:_,comment:B})}}function I(){var U=O(),H=F(r);if(H){if(W(),!F(s))return j("property missing ':'");var B=F(l),q=U({type:y,property:w(H[0].replace(e,m)),value:B?w(B[0].replace(e,m)):m});return F(a),q}}function $(){var U=[];P(U);for(var H;H=I();)H!==!1&&(U.push(H),P(U));return U}return G(),$()}function w(C){return C?C.replace(u,m):m}return Vv=S,Vv}var A2;function Eq(){if(A2)return aa;A2=1;var e=aa&&aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=n;const t=e(kq());function n(r,s){let l=null;if(!r||typeof r!="string")return l;const a=(0,t.default)(r),u=typeof s=="function";return a.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:p}=h;u?s(d,p,h):p&&(l=l||{},l[d]=p)}),l}return aa}var Qc={},D2;function Rq(){if(D2)return Qc;D2=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},a=function(d,p){return p.toUpperCase()},u=function(d,p){return"".concat(p,"-")},h=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,a))};return Qc.camelCase=h,Qc}var Jc,O2;function Tq(){if(O2)return Jc;O2=1;var e=Jc&&Jc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Eq()),n=Rq();function r(s,l){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(a[(0,n.camelCase)(u,l)]=h)}),a}return r.default=r,Jc=r,Jc}var Mq=Tq();const Nq=Jf(Mq),XA=ZA("end"),x0=ZA("start");function ZA(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 Aq(e){const t=x0(e),n=XA(e);if(t&&n)return{start:t,end:n}}function xu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?L2(e.position):"start"in e||"end"in e?L2(e):"line"in e||"column"in e?Ly(e):""}function Ly(e){return j2(e&&e.line)+":"+j2(e&&e.column)}function L2(e){return Ly(e&&e.start)+"-"+Ly(e&&e.end)}function j2(e){return e&&typeof e=="number"?e:1}class Bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(a=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?l.ruleId=r:(l.source=r.slice(0,h),l.ruleId=r.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.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=xu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bn.prototype.file="";Bn.prototype.name="";Bn.prototype.reason="";Bn.prototype.message="";Bn.prototype.stack="";Bn.prototype.column=void 0;Bn.prototype.line=void 0;Bn.prototype.ancestors=void 0;Bn.prototype.cause=void 0;Bn.prototype.fatal=void 0;Bn.prototype.place=void 0;Bn.prototype.ruleId=void 0;Bn.prototype.source=void 0;const S0={}.hasOwnProperty,Dq=new Map,Oq=/[A-Z]/g,Lq=new Set(["table","tbody","thead","tfoot","tr"]),jq=new Set(["td","th"]),QA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zq(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=Wq(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=$q(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"?b0:wq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=JA(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function JA(e,t,n){if(t.type==="element")return Pq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Bq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Hq(e,t,n);if(t.type==="mdxjsEsm")return Iq(e,t);if(t.type==="root")return Fq(e,t,n);if(t.type==="text")return Uq(e,t)}function Pq(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=b0,e.schema=s),e.ancestors.push(t);const l=t5(e,t.tagName,!1),a=Vq(e,t);let u=C0(e,t);return Lq.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!fq(h):!0})),e5(e,a,l,t),w0(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Bq(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)}Bu(e,t.position)}function Iq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bu(e,t.position)}function Hq(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=b0,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:t5(e,t.name,!0),a=qq(e,t),u=C0(e,t);return e5(e,a,l,t),w0(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Fq(e,t,n){const r={};return w0(r,C0(e,t)),e.create(t,e.Fragment,r,n)}function Uq(e,t){return t.value}function e5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function w0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $q(e,t,n){return r;function r(s,l,a,u){const d=Array.isArray(a.children)?n:t;return u?d(l,a,u):d(l,a)}}function Wq(e,t){return n;function n(r,s,l,a){const u=Array.isArray(l.children),h=x0(r);return t(s,l,a,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Vq(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&S0.call(t.properties,s)){const l=Kq(e,s,t.properties[s]);if(l){const[a,u]=l;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&jq.has(t.tagName)?r=u:n[a]=u}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function qq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Bu(e,t.position);else{const s=r.name;let l;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,l=e.evaluater.evaluateExpression(u.expression)}else Bu(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function C0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Dq;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=s.get(h)||0;a=h+"-"+d,s.set(h,d+1)}}const u=JA(e,l,a);u!==void 0&&n.push(u)}return n}function Kq(e,t,n){const r=bq(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aq(n):Cq(n)),r.property==="style"){let s=typeof n=="object"?n:Gq(e,String(n));return e.stylePropertyNameCase==="css"&&(s=Yq(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?vq[r.property]||r.property:r.attribute,n]}}function Gq(e,t){try{return Nq(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Bn("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=QA+"#cannot-parse-style-attribute",s}}function t5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,a;for(;++l<s.length;){const u=E2(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}r=a}else r=E2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return S0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bu(e)}function Bu(e,t){const n=new Bn("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=QA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yq(e){const t={};let n;for(n in e)S0.call(e,n)&&(t[Xq(n)]=e[n]);return t}function Xq(e){let t=e.replace(Oq,Zq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Zq(e){return"-"+e.toLowerCase()}const qv={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"]},Qq={};function k0(e,t){const n=Qq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return n5(e,r,s)}function n5(e,t,n){if(Jq(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 z2(e.children,t,n)}return Array.isArray(e)?z2(e,t,n):""}function z2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=n5(e[s],t,n);return r.join("")}function Jq(e){return!!(e&&typeof e=="object")}const P2=document.createElement("i");function E0(e){const t="&"+e+";";P2.innerHTML=t;const n=P2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Cr(e,t,n,r){const s=e.length;let l=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function $r(e,t){return e.length>0?(Cr(e,e.length,0,t),e):t}const B2={}.hasOwnProperty;function r5(e){const t={};let n=-1;for(;++n<e.length;)eK(t,e[n]);return t}function eK(e,t){let n;for(n in t){const s=(B2.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){B2.call(s,a)||(s[a]=[]);const u=l[a];tK(s[a],Array.isArray(u)?u:u?[u]:[])}}}function tK(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cr(e,0,0,r)}function i5(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 ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Vn=vo(/[A-Za-z]/),zn=vo(/[\dA-Za-z]/),nK=vo(/[#-'*+\--9=?A-Z^-~]/);function Kf(e){return e!==null&&(e<32||e===127)}const jy=vo(/\d/),rK=vo(/[\dA-Fa-f]/),iK=vo(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Lp=vo(new RegExp("\\p{P}|\\p{S}","u")),ol=vo(/\s/);function vo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ka(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&zn(e.charCodeAt(n+1))&&zn(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(a=String.fromCharCode(l,u),s=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function st(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(h){return Je(h)?(e.enter(n),u(h)):t(h)}function u(h){return Je(h)&&l++<s?(e.consume(h),u):(e.exit(n),t(h))}}const sK={tokenize:oK};function oK(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"),st(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),l(u)}function l(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return ze(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),a)}}const lK={tokenize:aK},I2={tokenize:cK};function aK(e){const t=this,n=[];let r=0,s,l,a;return u;function u(R){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,h,d)(R)}return d(R)}function h(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const M=t.events.length;let O=M,D;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){D=t.events[O][1].end;break}k(r);let j=M;for(;j<t.events.length;)t.events[j][1].end={...D},j++;return Cr(t.events,O+1,0,t.events.slice(M)),t.events.length=j,d(R)}return u(R)}function d(R){if(r===n.length){if(!s)return _(R);if(s.currentConstruct&&s.currentConstruct.concrete)return S(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I2,p,m)(R)}function p(R){return s&&T(),k(r),_(R)}function m(R){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(I2,y,S)(R)}function y(R){return r++,n.push([t.currentConstruct,t.containerState]),_(R)}function S(R){if(R===null){s&&T(),k(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return ze(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(R),w)}function C(R,M){const O=t.sliceStream(R);if(M&&O.push(null),R.previous=l,l&&(l.next=R),l=R,s.defineSkip(R.start),s.write(O),t.parser.lazy[R.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<a&&(!s.events[D][1].end||s.events[D][1].end.offset>a))return;const j=t.events.length;let F=j,G,P;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(G){P=t.events[F][1].end;break}G=!0}for(k(r),D=j;D<t.events.length;)t.events[D][1].end={...P},D++;Cr(t.events,F+1,0,t.events.slice(j)),t.events.length=D}}function k(R){let M=n.length;for(;M-- >R;){const O=n[M];t.containerState=O[1],O[0].exit.call(t,e)}n.length=R}function T(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function cK(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ma(e){if(e===null||wt(e)||ol(e))return 1;if(Lp(e))return 2}function jp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const zy={name:"attention",resolveAll:uK,tokenize:dK};function uK(e,t){let n=-1,r,s,l,a,u,h,d,p;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 m={...e[r][1].end},_={...e[n][1].start};H2(m,-h),H2(_,h),a={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=$r(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=$r(d,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",l,t]]),d=$r(d,jp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=$r(d,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=$r(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Cr(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dK(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Ma(r);let l;return a;function a(h){return l=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===l)return e.consume(h),u;const d=e.exit("attentionSequence"),p=Ma(h),m=!p||p===2&&s||n.includes(h),_=!s||s===2&&p||n.includes(r);return d._open=!!(l===42?m:m&&(s||!_)),d._close=!!(l===42?_:_&&(p||!m)),t(h)}}function H2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hK={name:"autolink",tokenize:fK};function fK(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"),l}function l(y){return Vn(y)?(e.consume(y),a):y===64?n(y):d(y)}function a(y){return y===43||y===45||y===46||zn(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||zn(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||Kf(y)?n(y):(e.consume(y),h)}function d(y){return y===64?(e.consume(y),p):nK(y)?(e.consume(y),d):n(y)}function p(y){return zn(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):_(y)}function _(y){if((y===45||zn(y))&&r++<63){const S=y===45?_:m;return e.consume(y),S}return n(y)}}const sd={partial:!0,tokenize:pK};function pK(e,t,n){return r;function r(l){return Je(l)?st(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||ze(l)?t(l):n(l)}}const s5={continuation:{tokenize:gK},exit:vK,name:"blockQuote",tokenize:mK};function mK(e,t,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function gK(e,t,n){const r=this;return s;function s(a){return Je(a)?st(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(s5,t,n)(a)}}function vK(e){e.exit("blockQuote")}const o5={name:"characterEscape",tokenize:_K};function _K(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return iK(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const l5={name:"characterReference",tokenize:yK};function yK(e,t,n){const r=this;let s=0,l,a;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,a=zn,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=rK,p):(e.enter("characterReferenceValue"),l=7,a=jy,p(m))}function p(m){if(m===59&&s){const _=e.exit("characterReferenceValue");return a===zn&&!E0(r.sliceSerialize(_))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(m)&&s++<l?(e.consume(m),p):n(m)}}const F2={partial:!0,tokenize:xK},U2={concrete:!0,name:"codeFenced",tokenize:bK};function bK(e,t,n){const r=this,s={partial:!0,tokenize:O};let l=0,a=0,u;return h;function h(D){return d(D)}function d(D){const j=r.events[r.events.length-1];return l=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===u?(a++,e.consume(D),p):a<3?n(D):(e.exit("codeFencedFenceSequence"),Je(D)?st(e,m,"whitespace")(D):m(D))}function m(D){return D===null||ze(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(F2,w,M)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(D)):Je(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),_)}function y(D){return D===null||ze(D)?m(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(D)):D===96&&D===u?n(D):(e.consume(D),S)}function w(D){return e.attempt(s,M,C)(D)}function C(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),k}function k(D){return l>0&&Je(D)?st(e,T,"linePrefix",l+1)(D):T(D)}function T(D){return D===null||ze(D)?e.check(F2,w,M)(D):(e.enter("codeFlowValue"),R(D))}function R(D){return D===null||ze(D)?(e.exit("codeFlowValue"),T(D)):(e.consume(D),R)}function M(D){return e.exit("codeFenced"),t(D)}function O(D,j,F){let G=0;return P;function P(H){return D.enter("lineEnding"),D.consume(H),D.exit("lineEnding"),W}function W(H){return D.enter("codeFencedFence"),Je(H)?st(D,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):I(H)}function I(H){return H===u?(D.enter("codeFencedFenceSequence"),$(H)):F(H)}function $(H){return H===u?(G++,D.consume(H),$):G>=a?(D.exit("codeFencedFenceSequence"),Je(H)?st(D,U,"whitespace")(H):U(H)):F(H)}function U(H){return H===null||ze(H)?(D.exit("codeFencedFence"),j(H)):F(H)}}}function xK(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Kv={name:"codeIndented",tokenize:wK},SK={partial:!0,tokenize:CK};function wK(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),st(e,l,"linePrefix",5)(d)}function l(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?h(d):ze(d)?e.attempt(SK,a,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||ze(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function CK(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):st(e,l,"linePrefix",5)(a)}function l(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):ze(a)?s(a):n(a)}}const kK={name:"codeText",previous:RK,resolve:EK,tokenize:TK};function EK(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 RK(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function TK(e,t,n){let r=0,s,l;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(l=e.enter("codeTextSequence"),s=0,p(m)):ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||ze(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",d(m))}}class MK{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 l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&eu(this.left,r),l.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),eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eu(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);eu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);eu(this.left,n.reverse())}}}function eu(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 a5(e){const t={};let n=-1,r,s,l,a,u,h,d;const p=new MK(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,NK(p,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(a=p.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},u=p.slice(s,n),u.unshift(r),p.splice(s,n-s+1,u))}}return Cr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function NK(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,h=[],d={};let p,m,_=-1,y=n,S=0,w=0;const C=[w];for(;y;){for(;e.get(++s)[1]!==y;);l.push(s),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),m&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(w=_+1,C.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=l.pop();h.push([T,T+k.length-1]),e.splice(T,2,k)}for(h.reverse(),_=-1;++_<h.length;)d[S+h[_][0]]=S+h[_][1],S+=h[_][1]-h[_][0]-1;return d}const AK={resolve:OK,tokenize:LK},DK={partial:!0,tokenize:jK};function OK(e){return a5(e),e}function LK(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?l(u):ze(u)?e.check(DK,a,l)(u):(e.consume(u),s)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function jK(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),st(e,l,"linePrefix")}function l(a){if(a===null||ze(a))return n(a);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(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function c5(e,t,n,r,s,l,a,u,h){const d=h||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(k),e.exit(l),_):k===null||k===32||k===41||Kf(k)?n(k):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),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),_(k)):k===null||k===60||ze(k)?n(k):(e.consume(k),k===92?S:y)}function S(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function w(k){return!p&&(k===null||k===41||wt(k))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(k)):p<d&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||Kf(k)?n(k):(e.consume(k),k===92?C:w)}function C(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function u5(e,t,n,r,s,l){const a=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(l),p}function p(y){return u>999||y===null||y===91||y===93&&!h||y===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(l),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||ze(y)||u++>999?(e.exit("chunkString"),p(y)):(e.consume(y),h||(h=!Je(y)),y===92?_:m)}function _(y){return y===91||y===92||y===93?(e.consume(y),u++,m):m(y)}}function d5(e,t,n,r,s,l){let a;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),a=_===40?41:_,h):n(_)}function h(_){return _===a?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(l),d(_))}function d(_){return _===a?(e.exit(l),h(a)):_===null?n(_):ze(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),st(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===a||_===null||ze(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?m:p)}function m(_){return _===a||_===92?(e.consume(_),p):p(_)}}function Su(e,t){let n;return r;function r(s){return ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Je(s)?st(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const zK={name:"definition",tokenize:BK},PK={partial:!0,tokenize:IK};function BK(e,t,n){const r=this;let s;return l;function l(y){return e.enter("definition"),a(y)}function a(y){return u5.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return s=ii(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 wt(y)?Su(e,d)(y):d(y)}function d(y){return c5(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(PK,m,m)(y)}function m(y){return Je(y)?st(e,_,"whitespace")(y):_(y)}function _(y){return y===null||ze(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function IK(e,t,n){return r;function r(u){return wt(u)?Su(e,s)(u):n(u)}function s(u){return d5(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return Je(u)?st(e,a,"whitespace")(u):a(u)}function a(u){return u===null||ze(u)?t(u):n(u)}}const HK={name:"hardBreakEscape",tokenize:FK};function FK(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return ze(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const UK={name:"headingAtx",resolve:$K,tokenize:WK};function $K(e,t){let n=e.length-2,r=3,s,l;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},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cr(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function WK(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||wt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||ze(p)?(e.exit("atxHeading"),t(p)):Je(p)?st(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||wt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const VK=["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"],$2=["pre","script","style","textarea"],qK={concrete:!0,name:"htmlFlow",resolveTo:YK,tokenize:XK},KK={partial:!0,tokenize:QK},GK={partial:!0,tokenize:ZK};function YK(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 XK(e,t,n){const r=this;let s,l,a,u,h;return d;function d(A){return p(A)}function p(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),_):A===47?(e.consume(A),l=!0,w):A===63?(e.consume(A),s=3,r.interrupt?t:N):Vn(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function _(A){return A===45?(e.consume(A),s=2,y):A===91?(e.consume(A),s=5,u=0,S):Vn(A)?(e.consume(A),s=4,r.interrupt?t:N):n(A)}function y(A){return A===45?(e.consume(A),r.interrupt?t:N):n(A)}function S(A){const oe="CDATA[";return A===oe.charCodeAt(u++)?(e.consume(A),u===oe.length?r.interrupt?t:I:S):n(A)}function w(A){return Vn(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||wt(A)){const oe=A===47,fe=a.toLowerCase();return!oe&&!l&&$2.includes(fe)?(s=1,r.interrupt?t(A):I(A)):VK.includes(a.toLowerCase())?(s=6,oe?(e.consume(A),k):r.interrupt?t(A):I(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):l?T(A):R(A))}return A===45||zn(A)?(e.consume(A),a+=String.fromCharCode(A),C):n(A)}function k(A){return A===62?(e.consume(A),r.interrupt?t:I):n(A)}function T(A){return Je(A)?(e.consume(A),T):P(A)}function R(A){return A===47?(e.consume(A),P):A===58||A===95||Vn(A)?(e.consume(A),M):Je(A)?(e.consume(A),R):P(A)}function M(A){return A===45||A===46||A===58||A===95||zn(A)?(e.consume(A),M):O(A)}function O(A){return A===61?(e.consume(A),D):Je(A)?(e.consume(A),O):R(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):Je(A)?(e.consume(A),D):F(A)}function j(A){return A===h?(e.consume(A),h=null,G):A===null||ze(A)?n(A):(e.consume(A),j)}function F(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||wt(A)?O(A):(e.consume(A),F)}function G(A){return A===47||A===62||Je(A)?R(A):n(A)}function P(A){return A===62?(e.consume(A),W):n(A)}function W(A){return A===null||ze(A)?I(A):Je(A)?(e.consume(A),W):n(A)}function I(A){return A===45&&s===2?(e.consume(A),B):A===60&&s===1?(e.consume(A),q):A===62&&s===4?(e.consume(A),z):A===63&&s===3?(e.consume(A),N):A===93&&s===5?(e.consume(A),Z):ze(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(KK,Y,$)(A)):A===null||ze(A)?(e.exit("htmlFlowData"),$(A)):(e.consume(A),I)}function $(A){return e.check(GK,U,Y)(A)}function U(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),H}function H(A){return A===null||ze(A)?$(A):(e.enter("htmlFlowData"),I(A))}function B(A){return A===45?(e.consume(A),N):I(A)}function q(A){return A===47?(e.consume(A),a="",V):I(A)}function V(A){if(A===62){const oe=a.toLowerCase();return $2.includes(oe)?(e.consume(A),z):I(A)}return Vn(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),V):I(A)}function Z(A){return A===93?(e.consume(A),N):I(A)}function N(A){return A===62?(e.consume(A),z):A===45&&s===2?(e.consume(A),N):I(A)}function z(A){return A===null||ze(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),z)}function Y(A){return e.exit("htmlFlow"),t(A)}}function ZK(e,t,n){const r=this;return s;function s(a){return ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function QK(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(sd,t,n)}}const JK={name:"htmlText",tokenize:eG};function eG(e,t,n){const r=this;let s,l,a;return u;function u(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),h}function h(N){return N===33?(e.consume(N),d):N===47?(e.consume(N),O):N===63?(e.consume(N),R):Vn(N)?(e.consume(N),F):n(N)}function d(N){return N===45?(e.consume(N),p):N===91?(e.consume(N),l=0,S):Vn(N)?(e.consume(N),T):n(N)}function p(N){return N===45?(e.consume(N),y):n(N)}function m(N){return N===null?n(N):N===45?(e.consume(N),_):ze(N)?(a=m,q(N)):(e.consume(N),m)}function _(N){return N===45?(e.consume(N),y):m(N)}function y(N){return N===62?B(N):N===45?_(N):m(N)}function S(N){const z="CDATA[";return N===z.charCodeAt(l++)?(e.consume(N),l===z.length?w:S):n(N)}function w(N){return N===null?n(N):N===93?(e.consume(N),C):ze(N)?(a=w,q(N)):(e.consume(N),w)}function C(N){return N===93?(e.consume(N),k):w(N)}function k(N){return N===62?B(N):N===93?(e.consume(N),k):w(N)}function T(N){return N===null||N===62?B(N):ze(N)?(a=T,q(N)):(e.consume(N),T)}function R(N){return N===null?n(N):N===63?(e.consume(N),M):ze(N)?(a=R,q(N)):(e.consume(N),R)}function M(N){return N===62?B(N):R(N)}function O(N){return Vn(N)?(e.consume(N),D):n(N)}function D(N){return N===45||zn(N)?(e.consume(N),D):j(N)}function j(N){return ze(N)?(a=j,q(N)):Je(N)?(e.consume(N),j):B(N)}function F(N){return N===45||zn(N)?(e.consume(N),F):N===47||N===62||wt(N)?G(N):n(N)}function G(N){return N===47?(e.consume(N),B):N===58||N===95||Vn(N)?(e.consume(N),P):ze(N)?(a=G,q(N)):Je(N)?(e.consume(N),G):B(N)}function P(N){return N===45||N===46||N===58||N===95||zn(N)?(e.consume(N),P):W(N)}function W(N){return N===61?(e.consume(N),I):ze(N)?(a=W,q(N)):Je(N)?(e.consume(N),W):G(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),s=N,$):ze(N)?(a=I,q(N)):Je(N)?(e.consume(N),I):(e.consume(N),U)}function $(N){return N===s?(e.consume(N),s=void 0,H):N===null?n(N):ze(N)?(a=$,q(N)):(e.consume(N),$)}function U(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||wt(N)?G(N):(e.consume(N),U)}function H(N){return N===47||N===62||wt(N)?G(N):n(N)}function B(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function q(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),V}function V(N){return Je(N)?st(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Z(N)}function Z(N){return e.enter("htmlTextData"),a(N)}}const R0={name:"labelEnd",resolveAll:iG,resolveTo:sG,tokenize:oG},tG={tokenize:lG},nG={tokenize:aG},rG={tokenize:cG};function iG(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&&Cr(e,0,e.length,n),e}function sG(e,t){let n=e.length,r=0,s,l,a,u;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=$r(u,e.slice(l+1,l+r+3)),u=$r(u,[["enter",p,t]]),u=$r(u,jp(t.parser.constructs.insideSpan.null,e.slice(l+r+4,a-3),t)),u=$r(u,[["exit",p,t],e[a-2],e[a-1],["exit",d,t]]),u=$r(u,e.slice(a+1)),u=$r(u,[["exit",h,t]]),Cr(e,l,e.length,u),e}function oG(e,t,n){const r=this;let s=r.events.length,l,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return u;function u(_){return l?l._inactive?m(_):(a=r.parser.defined.includes(ii(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):n(_)}function h(_){return _===40?e.attempt(tG,p,a?p:m)(_):_===91?e.attempt(nG,p,a?d:m)(_):a?p(_):m(_)}function d(_){return e.attempt(rG,p,m)(_)}function p(_){return t(_)}function m(_){return l._balanced=!0,n(_)}}function lG(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return wt(m)?Su(e,l)(m):l(m)}function l(m){return m===41?p(m):c5(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return wt(m)?Su(e,h)(m):p(m)}function u(m){return n(m)}function h(m){return m===34||m===39||m===40?d5(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return wt(m)?Su(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function aG(e,t,n){const r=this;return s;function s(u){return u5.call(r,e,l,a,"reference","referenceMarker","referenceString")(u)}function l(u){return r.parser.defined.includes(ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function cG(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const uG={name:"labelStartImage",resolveAll:R0.resolveAll,tokenize:dG};function dG(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const hG={name:"labelStartLink",resolveAll:R0.resolveAll,tokenize:fG};function fG(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Gv={name:"lineEnding",tokenize:pG};function pG(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),st(e,t,"linePrefix")}}const vf={name:"thematicBreak",tokenize:mG};function mG(e,t,n){let r=0,s;return l;function l(d){return e.enter("thematicBreak"),a(d)}function a(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||ze(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),Je(d)?st(e,u,"whitespace")(d):u(d))}}const sr={continuation:{tokenize:yG},exit:xG,name:"list",tokenize:_G},gG={partial:!0,tokenize:SG},vG={partial:!0,tokenize:bG};function _G(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(y){const S=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:jy(y)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(vf,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 jy(y)&&++a<10?(e.consume(y),h):(!r.interrupt||a<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(sd,r.interrupt?n:p,e.attempt(gG,_,m))}function p(y){return r.containerState.initialBlankLine=!0,l++,_(y)}function m(y){return Je(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),_):n(y)}function _(y){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function yG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sd,s,l);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(u)}function l(u){return r.containerState.furtherBlankLines||!Je(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vG,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(sr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function bG(e,t,n){const r=this;return st(e,s,"listItemIndent",r.containerState.size+1);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function xG(e){e.exit(this.containerState.type)}function SG(e,t,n){const r=this;return st(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const a=r.events[r.events.length-1];return!Je(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const W2={name:"setextUnderline",resolveTo:wG,tokenize:CG};function wG(e,t){let n=e.length,r,s,l;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),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",a,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function CG(e,t,n){const r=this;let s;return l;function l(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Je(d)?st(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||ze(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kG={tokenize:EG};function EG(e){const t=this,n=e.attempt(sd,r,e.attempt(this.parser.constructs.flowInitial,s,st(e,e.attempt(this.parser.constructs.flow,s,e.attempt(AK,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const RG={resolveAll:f5()},TG=h5("string"),MG=h5("text");function h5(e){return{resolveAll:f5(e==="text"?NG:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,a,u);return a;function a(p){return d(p)?l(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),h}function h(p){return d(p)?(n.exit("data"),l(p)):(n.consume(p),h)}function d(p){if(p===null)return!0;const m=s[p];let _=-1;if(m)for(;++_<m.length;){const y=m[_];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function f5(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function NG(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 l=s.length,a=-1,u=0,h;for(;l--;){const d=s[l];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)h=!0,u++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:r.start._bufferIndex+a,_index:r.start._index+l,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 AG={42:sr,43:sr,45:sr,48:sr,49:sr,50:sr,51:sr,52:sr,53:sr,54:sr,55:sr,56:sr,57:sr,62:s5},DG={91:zK},OG={[-2]:Kv,[-1]:Kv,32:Kv},LG={35:UK,42:vf,45:[W2,vf],60:qK,61:W2,95:vf,96:U2,126:U2},jG={38:l5,92:o5},zG={[-5]:Gv,[-4]:Gv,[-3]:Gv,33:uG,38:l5,42:zy,60:[hK,JK],91:hG,92:[HK,o5],93:R0,95:zy,96:kK},PG={null:[zy,RG]},BG={null:[42,95]},IG={null:[]},HG=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:BG,contentInitial:DG,disable:IG,document:AG,flow:LG,flowInitial:OG,insideSpan:PG,string:jG,text:zG},Symbol.toStringTag,{value:"Module"}));function FG(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={},l=[];let a=[],u=[];const h={attempt:j(O),check:j(D),consume:T,enter:R,exit:M,interrupt:j(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:y,write:m};let p=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function m(W){return a=$r(a,W),C(),a[a.length-1]!==null?[]:(F(t,0),d.events=jp(l,d.events,d),d.events)}function _(W,I){return $G(y(W),I)}function y(W){return UG(a,W)}function S(){const{_bufferIndex:W,_index:I,line:$,column:U,offset:H}=r;return{_bufferIndex:W,_index:I,line:$,column:U,offset:H}}function w(W){s[W.line]=W.column,P()}function C(){let W;for(;r._index<a.length;){const I=a[r._index];if(typeof I=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<I.length;)k(I.charCodeAt(r._bufferIndex));else k(I)}}function k(W){p=p(W)}function T(W){ze(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,P()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=W}function R(W,I){const $=I||{};return $.type=W,$.start=S(),d.events.push(["enter",$,d]),u.push($),$}function M(W){const I=u.pop();return I.end=S(),d.events.push(["exit",I,d]),I}function O(W,I){F(W,I.from)}function D(W,I){I.restore()}function j(W,I){return $;function $(U,H,B){let q,V,Z,N;return Array.isArray(U)?Y(U):"tokenize"in U?Y([U]):z(U);function z(se){return J;function J(ge){const ie=ge!==null&&se[ge],ce=ge!==null&&se.null,we=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return Y(we)(ge)}}function Y(se){return q=se,V=0,se.length===0?B:A(se[V])}function A(se){return J;function J(ge){return N=G(),Z=se,se.partial||(d.currentConstruct=se),se.name&&d.parser.constructs.disable.null.includes(se.name)?fe():se.tokenize.call(I?Object.assign(Object.create(d),I):d,h,oe,fe)(ge)}}function oe(se){return W(Z,N),H}function fe(se){return N.restore(),++V<q.length?A(q[V]):B}}}function F(W,I){W.resolveAll&&!l.includes(W)&&l.push(W),W.resolve&&Cr(d.events,I,d.events.length-I,W.resolve(d.events.slice(I),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function G(){const W=S(),I=d.previous,$=d.currentConstruct,U=d.events.length,H=Array.from(u);return{from:U,restore:B};function B(){r=W,d.previous=I,d.currentConstruct=$,d.events.length=U,u=H,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function UG(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,l)];else{if(a=e.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}l>0&&a.push(e[s].slice(0,l))}return a}function $G(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
|
|
504
|
+
`;break}case-3:{a=`\r
|
|
505
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(l)}s=l===-2,r.push(a)}return r.join("")}function WG(e){const r={constructs:r5([HG,...(e||{}).extensions||[]]),content:s(sK),defined:[],document:s(lK),flow:s(kG),lazy:{},string:s(TG),text:s(MG)};return r;function s(l){return a;function a(u){return FG(r,l,u)}}}function VG(e){for(;!a5(e););return e}const V2=/[\0\t\n\r]/g;function qG(){let e=1,t="",n=!0,r;return s;function s(l,a,u){const h=[];let d,p,m,_,y;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(V2.lastIndex=m,d=V2.exec(l),_=d&&d.index!==void 0?d.index:l.length,y=l.charCodeAt(_),!d){t=l.slice(m);break}if(y===10&&m===_&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),m<_&&(h.push(l.slice(m,_)),e+=_-m),y){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}m=_+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const KG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GG(e){return e.replace(KG,YG)}function YG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return i5(n.slice(l?2:1),l?16:10)}return E0(n)||e}const p5={}.hasOwnProperty;function XG(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ZG(n)(VG(WG(n).document().write(qG()(e,t,!0))))}function ZG(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(xt),autolinkProtocol:G,autolinkEmail:G,atxHeading:l(Ce),blockQuote:l(ce),characterEscape:G,characterReference:G,codeFenced:l(we),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(we,a),codeText:l(Se,a),codeTextData:G,data:G,codeFlowValue:G,definition:l(ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(Be),hardBreakEscape:l(Oe),hardBreakTrailing:l(Oe),htmlFlow:l(bt,a),htmlFlowData:G,htmlText:l(bt,a),htmlTextData:G,image:l(hn),label:a,link:l(xt),listItem:l(In),listItemValue:_,listOrdered:l(zt,m),listUnordered:l(zt),paragraph:l(cr),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(Ce),strong:l(Gr),thematicBreak:l(Rt)},exit:{atxHeading:h(),atxHeadingSequence:O,autolink:h(),autolinkEmail:ie,autolinkProtocol:ge,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:se,characterReference:J,codeFenced:h(C),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:h(k),codeText:h(H),codeTextData:P,data:P,definition:h(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(I),hardBreakTrailing:h(I),htmlFlow:h($),htmlFlowData:P,htmlText:h(U),htmlTextData:P,image:h(q),label:Z,labelText:V,lineEnding:W,link:h(B),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:N,resourceTitleString:z,resource:Y,setextHeading:h(F),setextHeadingLineSequence:j,setextHeadingText:D,strong:h(),thematicBreak:h()}};m5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let ve={type:"root",children:[]};const Le={stack:[ve],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:p,data:n},Ie=[];let Xe=-1;for(;++Xe<ue.length;)if(ue[Xe][1].type==="listOrdered"||ue[Xe][1].type==="listUnordered")if(ue[Xe][0]==="enter")Ie.push(Xe);else{const Ct=Ie.pop();Xe=s(ue,Ct,Xe)}for(Xe=-1;++Xe<ue.length;){const Ct=t[ue[Xe][0]];p5.call(Ct,ue[Xe][1].type)&&Ct[ue[Xe][1].type].call(Object.assign({sliceSerialize:ue[Xe][2].sliceSerialize},Le),ue[Xe][1])}if(Le.tokenStack.length>0){const Ct=Le.tokenStack[Le.tokenStack.length-1];(Ct[1]||q2).call(Le,void 0,Ct[0])}for(ve.position={start:Xs(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Xs(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)ve=t.transforms[Xe](ve)||ve;return ve}function s(ue,ve,Le){let Ie=ve-1,Xe=-1,Ct=!1,Yn,nn,Pt,Gt;for(;++Ie<=Le;){const ot=ue[Ie];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Xe++:Xe--,Gt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(Yn&&!Gt&&!Xe&&!Pt&&(Pt=Ie),Gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gt=void 0}if(!Xe&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Xe===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(Yn){let Xn=Ie;for(nn=void 0;Xn--;){const Dn=ue[Xn];if(Dn[1].type==="lineEnding"||Dn[1].type==="lineEndingBlank"){if(Dn[0]==="exit")continue;nn&&(ue[nn][1].type="lineEndingBlank",Ct=!0),Dn[1].type="lineEnding",nn=Xn}else if(!(Dn[1].type==="linePrefix"||Dn[1].type==="blockQuotePrefix"||Dn[1].type==="blockQuotePrefixWhitespace"||Dn[1].type==="blockQuoteMarker"||Dn[1].type==="listItemIndent"))break}Pt&&(!nn||Pt<nn)&&(Yn._spread=!0),Yn.end=Object.assign({},nn?ue[nn][1].start:ot[1].end),ue.splice(nn||Ie,0,["exit",Yn,ot[2]]),Ie++,Le++}if(ot[1].type==="listItemPrefix"){const Xn={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};Yn=Xn,ue.splice(Ie,0,["enter",Xn,ot[2]]),Ie++,Le++,Pt=void 0,Gt=!0}}}return ue[ve][1]._spread=Ct,Le}function l(ue,ve){return Le;function Le(Ie){u.call(this,ue(Ie),Ie),ve&&ve.call(this,Ie)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(ue,ve,Le){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ve,Le||void 0]),ue.position={start:Xs(ve.start),end:void 0}}function h(ue){return ve;function ve(Le){ue&&ue.call(this,Le),d.call(this,Le)}}function d(ue,ve){const Le=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ue.type&&(ve?ve.call(this,ue,Ie[0]):(Ie[1]||q2).call(this,ue,Ie[0]));else throw new Error("Cannot close `"+ue.type+"` ("+xu({start:ue.start,end:ue.end})+"): it’s not open");Le.position.end=Xs(ue.end)}function p(){return k0(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function _(ue){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ue}function S(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/(\r?\n|\r)$/g,"")}function T(ue){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ve,Le.identifier=ii(this.sliceSerialize(ue)).toLowerCase()}function R(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function M(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function O(ue){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Le=this.sliceSerialize(ue).length;ve.depth=Le}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function j(ue){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ue){const Le=this.stack[this.stack.length-1].children;let Ie=Le[Le.length-1];(!Ie||Ie.type!=="text")&&(Ie=le(),Ie.position={start:Xs(ue.start),end:void 0},Le.push(Ie)),this.stack.push(Ie)}function P(ue){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ue),ve.position.end=Xs(ue.end)}function W(ue){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ve.children[ve.children.length-1];Le.position.end=Xs(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(G.call(this,ue),P.call(this,ue))}function I(){this.data.atHardBreak=!0}function $(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function U(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function H(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function B(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function V(ue){const ve=this.sliceSerialize(ue),Le=this.stack[this.stack.length-2];Le.label=GG(ve),Le.identifier=ii(ve).toLowerCase()}function Z(){const ue=this.stack[this.stack.length-1],ve=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ie=ue.children;Le.children=Ie}else Le.alt=ve}function N(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function z(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function oe(ue){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ve,Le.identifier=ii(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function fe(ue){this.data.characterReferenceType=ue.type}function se(ue){const ve=this.sliceSerialize(ue),Le=this.data.characterReferenceType;let Ie;Le?(Ie=i5(ve,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=E0(ve);const Xe=this.stack[this.stack.length-1];Xe.value+=Ie}function J(ue){const ve=this.stack.pop();ve.position.end=Xs(ue.end)}function ge(ue){P.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ue)}function ie(ue){P.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ue)}function ce(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function bt(){return{type:"html",value:""}}function hn(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function zt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function In(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function cr(){return{type:"paragraph",children:[]}}function Gr(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function m5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?m5(e,r):QG(e,r)}}function QG(e,t){let n;for(n in t)if(p5.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 q2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xu({start:t.start,end:t.end})+") is still open")}function JG(e){const t=this;t.parser=n;function n(r){return XG(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function eY(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 tY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
506
|
+
`}]}function nY(e,t){const n=t.value?t.value+`
|
|
507
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function rY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ka(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+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(a)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function oY(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 lY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function g5(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),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function aY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g5(e,t);const s={src:Ka(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function cY(e,t){const n={src:Ka(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 uY(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 dY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g5(e,t);const s={href:Ka(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function hY(e,t){const n={href:Ka(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 fY(e,t,n){const r=e.all(t),s=n?pY(n):v5(t),l={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
|
|
508
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?a.push(...p.children):a.push(p)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
|
509
|
+
`});const d={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,d),e.applyData(t,d)}function pY(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=v5(n[r])}return t}function v5(e){const t=e.spread;return t??e.children.length>1}function mY(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 a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function gY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _Y(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yY(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=x0(t.children[1]),h=XA(t.children[t.children.length-1]);u&&h&&(a.position={start:u,end:h}),s.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function bY(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const m=t.children[h],_={},y=a?a[h]:void 0;y&&(_.align=y);let S={type:"element",tagName:l,properties:_,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),d.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function xY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const K2=9,G2=32;function SY(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const l=[];for(;r;)l.push(Y2(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return l.push(Y2(t.slice(s),s>0,!1)),l.join("")}function Y2(e,t,n){let r=0,s=e.length;if(t){let l=e.codePointAt(r);for(;l===K2||l===G2;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(s-1);for(;l===K2||l===G2;)s--,l=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function wY(e,t){const n={type:"text",value:SY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kY={blockquote:eY,break:tY,code:nY,delete:rY,emphasis:iY,footnoteReference:sY,heading:oY,html:lY,imageReference:aY,image:cY,inlineCode:uY,linkReference:dY,link:hY,listItem:fY,list:mY,paragraph:gY,root:vY,strong:_Y,table:yY,tableCell:xY,tableRow:bY,text:wY,thematicBreak:CY,toml:Vh,yaml:Vh,definition:Vh,footnoteDefinition:Vh};function Vh(){}const _5=-1,zp=0,wu=1,Gf=2,T0=3,M0=4,N0=5,A0=6,y5=7,b5=8,X2=typeof self=="object"?self:globalThis,EY=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),r=s=>{if(e.has(s))return e.get(s);const[l,a]=t[s];switch(l){case zp:case _5:return n(a,s);case wu:{const u=n([],s);for(const h of a)u.push(r(h));return u}case Gf:{const u=n({},s);for(const[h,d]of a)u[r(h)]=r(d);return u}case T0:return n(new Date(a),s);case M0:{const{source:u,flags:h}=a;return n(new RegExp(u,h),s)}case N0:{const u=n(new Map,s);for(const[h,d]of a)u.set(r(h),r(d));return u}case A0:{const u=n(new Set,s);for(const h of a)u.add(r(h));return u}case y5:{const{name:u,message:h}=a;return n(new X2[u](h),s)}case b5:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new X2[l](a),s)};return r},Z2=e=>EY(new Map,e)(0),ca="",{toString:RY}={},{keys:TY}=Object,tu=e=>{const t=typeof e;if(t!=="object"||!e)return[zp,t];const n=RY.call(e).slice(8,-1);switch(n){case"Array":return[wu,ca];case"Object":return[Gf,ca];case"Date":return[T0,ca];case"RegExp":return[M0,ca];case"Map":return[N0,ca];case"Set":return[A0,ca];case"DataView":return[wu,n]}return n.includes("Array")?[wu,n]:n.includes("Error")?[y5,n]:[Gf,n]},qh=([e,t])=>e===zp&&(t==="function"||t==="symbol"),MY=(e,t,n,r)=>{const s=(a,u)=>{const h=r.push(a)-1;return n.set(u,h),h},l=a=>{if(n.has(a))return n.get(a);let[u,h]=tu(a);switch(u){case zp:{let p=a;switch(h){case"bigint":u=b5,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return s([_5],a)}return s([u,p],a)}case wu:{if(h){let _=a;return h==="DataView"?_=new Uint8Array(a.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(a)),s([h,[..._]],a)}const p=[],m=s([u,p],a);for(const _ of a)p.push(l(_));return m}case Gf:{if(h)switch(h){case"BigInt":return s([h,a.toString()],a);case"Boolean":case"Number":case"String":return s([h,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const p=[],m=s([u,p],a);for(const _ of TY(a))(e||!qh(tu(a[_])))&&p.push([l(_),l(a[_])]);return m}case T0:return s([u,a.toISOString()],a);case M0:{const{source:p,flags:m}=a;return s([u,{source:p,flags:m}],a)}case N0:{const p=[],m=s([u,p],a);for(const[_,y]of a)(e||!(qh(tu(_))||qh(tu(y))))&&p.push([l(_),l(y)]);return m}case A0:{const p=[],m=s([u,p],a);for(const _ of a)(e||!qh(tu(_)))&&p.push(l(_));return m}}const{message:d}=a;return s([u,{name:h,message:d}],a)};return l},Q2=(e,{json:t,lossy:n}={})=>{const r=[];return MY(!(t||n),!!t,new Map,r)(e),r},Yf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Z2(Q2(e,t)):structuredClone(e):(e,t)=>Z2(Q2(e,t));function NY(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 AY(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DY(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NY,r=e.options.footnoteBackLabel||AY,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=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 p=e.all(d),m=String(d.identifier).toUpperCase(),_=Ka(m.toLowerCase());let y=0;const S=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++y<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(h,y);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,y),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const T=C.children[C.children.length-1];T&&T.type==="text"?T.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else p.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!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:l,properties:{...Yf(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
510
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
511
|
+
`}]}}const Pp=(function(e){if(e==null)return zY;if(typeof e=="function")return Bp(e);if(typeof e=="object")return Array.isArray(e)?OY(e):LY(e);if(typeof e=="string")return jY(e);throw new Error("Expected function, string, or object as test")});function OY(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pp(e[n]);return Bp(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function LY(e){const t=e;return Bp(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function jY(e){return Bp(t);function t(n){return n&&n.type===e}}function Bp(e){return t;function t(n,r,s){return!!(PY(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function zY(){return!0}function PY(e){return e!==null&&typeof e=="object"&&"type"in e}const x5=[],BY=!0,Py=!1,IY="skip";function S5(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const l=Pp(s),a=r?-1:1;u(e,void 0,[])();function u(h,d,p){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return _;function _(){let y=x5,S,w,C;if((!t||l(h,d,p[p.length-1]||void 0))&&(y=HY(n(h,p)),y[0]===Py))return y;if("children"in h&&h.children){const k=h;if(k.children&&y[0]!==IY)for(w=(r?k.children.length:-1)+a,C=p.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===Py)return S;w=typeof S[1]=="number"?S[1]:w+a}}return y}}}function HY(e){return Array.isArray(e)?e:typeof e=="number"?[BY,e]:e==null?x5:[e]}function D0(e,t,n,r){let s,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,s=n):(l=t,a=n,s=r),S5(e,l,u,s);function u(h,d){const p=d[d.length-1],m=p?p.children.indexOf(h):void 0;return a(h,m,p)}}const By={}.hasOwnProperty,FY={};function UY(e,t){const n=t||FY,r=new Map,s=new Map,l=new Map,a={...kY,...n.handlers},u={all:d,applyData:WY,definitionById:r,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:a,one:h,options:n,patch:$Y,wrap:qY};return D0(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,_=String(p.identifier).toUpperCase();m.has(_)||m.set(_,p)}}),u;function h(p,m){const _=p.type,y=u.handlers[_];if(By.call(u.handlers,_)&&y)return y(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in p){const{children:w,...C}=p,k=Yf(C);return k.children=u.all(p),k}return Yf(p)}return(u.options.unknownHandler||VY)(u,p,m)}function d(p){const m=[];if("children"in p){const _=p.children;let y=-1;for(;++y<_.length;){const S=u.one(_[y],p);if(S){if(y&&_[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=J2(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=J2(w.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function $Y(e,t){e.position&&(t.position=Aq(e))}function WY(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,Yf(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function VY(e,t){const n=t.data||{},r="value"in t&&!(By.call(n,"hProperties")||By.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 qY(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
512
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
513
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
514
|
+
`}),n}function J2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eE(e,t){const n=UY(e,t),r=n.one(e,void 0),s=DY(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
515
|
+
`},s),l}function KY(e,t){return e&&"run"in e?async function(n,r){const s=eE(n,{file:r,...t});await e.run(s,r)}:function(n,r){return eE(n,{file:r,...e||t})}}function tE(e){if(e)throw e}var Yv,nE;function GY(){if(nE)return Yv;nE=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]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},a=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Yv=function h(){var d,p,m,_,y,S,w=arguments[0],C=1,k=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<k;++C)if(d=arguments[C],d!=null)for(p in d)m=u(w,p),_=u(d,p),w!==_&&(T&&_&&(l(_)||(y=s(_)))?(y?(y=!1,S=m&&s(m)?m:[]):S=m&&l(m)?m:{},a(w,{name:p,newValue:h(T,S,_)})):typeof _<"u"&&a(w,{name:p,newValue:_}));return w},Yv}var YY=GY();const Xv=Jf(YY);function Iy(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 XY(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...s);function u(h,...d){const p=e[++l];let m=-1;if(h){a(h);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,p?ZY(p,u)(...d):a(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 ZY(e,t){let n;return r;function r(...a){const u=e.length>a.length;let h;u&&a.push(s);try{h=e.apply(this,a)}catch(d){const p=d;if(u&&n)throw p;return s(p)}u||(h&&h.then&&typeof h.then=="function"?h.then(l,s):h instanceof Error?s(h):l(h))}function s(a,...u){n||(n=!0,t(a,...u))}function l(a){s(null,a)}}const yi={basename:QY,dirname:JY,extname:eX,join:tX,sep:"/"};function QY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');od(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function JY(e){if(od(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 eX(e){od(e);let t=e.length,n=-1,r=0,s=-1,l=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function tX(...e){let t=-1,n;for(;++t<e.length;)od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":nX(n)}function nX(e){od(e);const t=e.codePointAt(0)===47;let n=rX(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rX(e,t){let n="",r=0,s=-1,l=0,a=-1,u,h;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(s===a-1||l===1))if(s!==a-1&&l===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=a,l=0;continue}}else if(n.length>0){n="",r=0,s=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,l=0}else u===46&&l>-1?l++:l=-1}return n}function od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iX={cwd:sX};function sX(){return"/"}function Hy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oX(e){if(typeof e=="string")e=new URL(e);else if(!Hy(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 lX(e)}function lX(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 Zv=["history","path","basename","stem","extname","dirname"];class w5{constructor(t){let n;t?Hy(t)?n={path:t}:typeof t=="string"||aX(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":iX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zv.length;){const l=Zv[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Zv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?yi.basename(this.path):void 0}set basename(t){Jv(t,"basename"),Qv(t,"basename"),this.path=yi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yi.dirname(this.path):void 0}set dirname(t){rE(this.basename,"dirname"),this.path=yi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yi.extname(this.path):void 0}set extname(t){if(Qv(t,"extname"),rE(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=yi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hy(t)&&(t=oX(t)),Jv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yi.basename(this.path,this.extname):void 0}set stem(t){Jv(t,"stem"),Qv(t,"stem"),this.path=yi.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 Bn(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 Qv(e,t){if(e&&e.includes(yi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yi.sep+"`")}function Jv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cX=(function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),uX={}.hasOwnProperty;class O0 extends cX{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=XY()}copy(){const t=new O0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Xv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(n_("data",this.frozen),this.namespace[t]=n,this):uX.call(this.namespace,t)&&this.namespace[t]||void 0:t?(n_("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=Kh(t),r=this.parser||this.Parser;return e_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),e_("process",this.parser||this.Parser),t_("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,a){const u=Kh(t),h=r.parse(u);r.run(h,u,function(p,m,_){if(p||!m||!_)return d(p);const y=m,S=r.stringify(y,_);fX(S)?_.value=S:_.result=S,d(p,_)});function d(p,m){p||!m?a(p):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),e_("processSync",this.parser||this.Parser),t_("processSync",this.compiler||this.Compiler),this.process(t,s),sE("processSync","process",n),r;function s(l,a){n=!0,tE(l),r=a}}run(t,n,r){iE(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,u){const h=Kh(n);s.run(t,h,d);function d(p,m,_){const y=m||t;p?u(p):a?a(y):r(void 0,y,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),sE("runSync","run",r),s;function l(a,u){tE(a),s=u,r=!0}}stringify(t,n){this.freeze();const r=Kh(n),s=this.compiler||this.Compiler;return t_("stringify",s),iE(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(n_("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;h(p,m)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(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=Xv(!0,s.settings,d.settings))}function u(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];l(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,p){let m=-1,_=-1;for(;++m<r.length;)if(r[m][0]===d){_=m;break}if(_===-1)r.push([d,...p]);else if(p.length>0){let[y,...S]=p;const w=r[_][1];Iy(w)&&Iy(y)&&(y=Xv(!0,w,y)),r[_]=[d,y,...S]}}}}const dX=new O0().freeze();function e_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function t_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function n_(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 iE(e){if(!Iy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Kh(e){return hX(e)?e:new w5(e)}function hX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fX(e){return typeof e=="string"||pX(e)}function pX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",oE=[],lE={allowDangerousHtml:!0},gX=/^(https?|ircs?|mailto|xmpp)$/i,vX=[{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 ld(e){const t=_X(e),n=yX(e);return bX(t.runSync(t.parse(n),n),e)}function _X(e){const t=e.rehypePlugins||oE,n=e.remarkPlugins||oE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lE}:lE;return dX().use(JG).use(n).use(KY,r).use(t)}function yX(e){const t=e.children||"",n=new w5;return typeof t=="string"&&(n.value=t),n}function bX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,l=t.disallowedElements,a=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||xX;for(const p of vX)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+mX+p.id,void 0);return D0(e,d),zq(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function d(p,m,_){if(p.type==="raw"&&_&&typeof m=="number")return a?_.children.splice(m,1):_.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let y;for(y in qv)if(Object.hasOwn(qv,y)&&Object.hasOwn(p.properties,y)){const S=p.properties[y],w=qv[y];(w===null||w.includes(p.tagName))&&(p.properties[y]=h(String(S||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(p,m,_)),y&&_&&typeof m=="number")return u&&p.children?_.children.splice(m,1,...p.children):_.children.splice(m,1),m}}}function xX(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||gX.test(e.slice(0,t))?e:""}function aE(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 SX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wX(e,t,n){const s=Pp((n||{}).ignore||[]),l=CX(t);let a=-1;for(;++a<l.length;)S5(e,"text",u);function u(d,p){let m=-1,_;for(;++m<p.length;){const y=p[m],S=_?_.children:void 0;if(s(y,S?S.indexOf(y):void 0,_))return;_=y}if(_)return h(d,p)}function h(d,p){const m=p[p.length-1],_=l[a][0],y=l[a][1];let S=0;const C=m.children.indexOf(d);let k=!1,T=[];_.lastIndex=0;let R=_.exec(d.value);for(;R;){const M=R.index,O={index:R.index,input:R.input,stack:[...p,d]};let D=y(...R,O);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?_.lastIndex=M+1:(S!==M&&T.push({type:"text",value:d.value.slice(S,M)}),Array.isArray(D)?T.push(...D):D&&T.push(D),S=M+R[0].length,k=!0),!_.global)break;R=_.exec(d.value)}return k?(S<d.value.length&&T.push({type:"text",value:d.value.slice(S)}),m.children.splice(C,1,...T)):T=[d],C+T.length}}function CX(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([kX(s[0]),EX(s[1])])}return t}function kX(e){return typeof e=="string"?new RegExp(SX(e),"g"):e}function EX(e){return typeof e=="function"?e:function(){return e}}const r_="phrasing",i_=["autolink","link","image","label"];function RX(){return{transforms:[LX],enter:{literalAutolink:MX,literalAutolinkEmail:s_,literalAutolinkHttp:s_,literalAutolinkWww:s_},exit:{literalAutolink:OX,literalAutolinkEmail:DX,literalAutolinkHttp:NX,literalAutolinkWww:AX}}}function TX(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:r_,notInConstruct:i_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:r_,notInConstruct:i_},{character:":",before:"[ps]",after:"\\/",inConstruct:r_,notInConstruct:i_}]}}function MX(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function s_(e){this.config.enter.autolinkProtocol.call(this,e)}function NX(e){this.config.exit.autolinkProtocol.call(this,e)}function AX(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 DX(e){this.config.exit.autolinkEmail.call(this,e)}function OX(e){this.exit(e)}function LX(e){wX(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jX],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zX]],{ignore:["link","linkReference"]})}function jX(e,t,n,r,s){let l="";if(!C5(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!PX(n)))return!1;const a=BX(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function zX(e,t,n,r){return!C5(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function PX(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 BX(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=aE(e,"(");let l=aE(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function C5(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ol(n)||Lp(n))&&(!t||n!==47)}k5.peek=KX;function IX(){this.buffer()}function HX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FX(){this.buffer()}function UX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $X(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ii(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WX(e){this.exit(e)}function VX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ii(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qX(e){this.exit(e)}function KX(){return"["}function k5(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),u(),a(),l+=s.move("]"),l}function GX(){return{enter:{gfmFootnoteCallString:IX,gfmFootnoteCall:HX,gfmFootnoteDefinitionLabelString:FX,gfmFootnoteDefinition:UX},exit:{gfmFootnoteCallString:$X,gfmFootnoteCall:WX,gfmFootnoteDefinitionLabelString:VX,gfmFootnoteDefinition:qX}}}function YX(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:k5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,a){const u=l.createTracker(a);let h=u.move("[^");const d=l.enter("footnoteDefinition"),p=l.enter("label");return h+=u.move(l.safe(l.associationId(r),{before:h,after:"]"})),p(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
516
|
+
`:" ")+l.indentLines(l.containerFlow(r,u.current()),t?E5:XX))),d(),h}}function XX(e,t,n){return t===0?e:E5(e,t,n)}function E5(e,t,n){return(n?"":" ")+e}const ZX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];R5.peek=nZ;function QX(){return{canContainEols:["delete"],enter:{strikethrough:eZ},exit:{strikethrough:tZ}}}function JX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZX}],handlers:{delete:R5}}}function eZ(e){this.enter({type:"delete",children:[]},e)}function tZ(e){this.exit(e)}function R5(e,t,n,r){const s=n.createTracker(r),l=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),l(),a}function nZ(){return"~"}function rZ(e){return e.length}function iZ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||rZ,l=[],a=[],u=[],h=[];let d=0,p=-1;for(;++p<e.length;){const w=[],C=[];let k=-1;for(e[p].length>d&&(d=e[p].length);++k<e[p].length;){const T=sZ(e[p][k]);if(n.alignDelimiters!==!1){const R=s(T);C[k]=R,(h[k]===void 0||R>h[k])&&(h[k]=R)}w.push(T)}a[p]=w,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)l[m]=cE(r[m]);else{const w=cE(r);for(;++m<d;)l[m]=w}m=-1;const _=[],y=[];for(;++m<d;){const w=l[m];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,h[m]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>h[m]&&(h[m]=T),y[m]=T),_[m]=R}a.splice(1,0,_),u.splice(1,0,y),p=-1;const S=[];for(;++p<a.length;){const w=a[p],C=u[p];m=-1;const k=[];for(;++m<d;){const T=w[m]||"";let R="",M="";if(n.alignDelimiters!==!1){const O=h[m]-(C[m]||0),D=l[m];D===114?R=" ".repeat(O):D===99?O%2?(R=" ".repeat(O/2+.5),M=" ".repeat(O/2-.5)):(R=" ".repeat(O/2),M=R):M=" ".repeat(O)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(R),k.push(T),n.alignDelimiters!==!1&&k.push(M),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
517
|
+
`)}function sZ(e){return e==null?"":String(e)}function cE(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 oZ(e,t,n,r){const s=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),lZ);return s(),a}function lZ(e,t,n){return">"+(n?"":" ")+e}function aZ(e,t){return uE(e,t.inConstruct,!0)&&!uE(e,t.notInConstruct,!1)}function uE(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 dE(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
518
|
+
`&&aZ(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
519
|
+
`}function cZ(e,t){const n=String(e);let r=n.indexOf(t),s=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++l>a&&(a=l):l=1,s=r+t.length,r=n.indexOf(t,s);return a}function uZ(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 dZ(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 hZ(e,t,n,r){const s=dZ(n),l=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(uZ(e,n)){const m=n.enter("codeIndented"),_=n.indentLines(l,fZ);return m(),_}const u=n.createTracker(r),h=s.repeat(Math.max(cZ(l,s)+1,3)),d=n.enter("codeFenced");let p=u.move(h);if(e.lang){const m=n.enter(`codeFencedLang${a}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${a}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
|
|
520
|
+
`,encode:["`"],...u.current()})),m()}return p+=u.move(`
|
|
521
|
+
`),l&&(p+=u.move(l+`
|
|
522
|
+
`)),p+=u.move(h),d(),p}function fZ(e,t,n){return(n?"":" ")+e}function L0(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 pZ(e,t,n,r){const s=L0(n),l=s==='"'?"Quote":"Apostrophe",a=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?" ":`
|
|
523
|
+
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),a(),d}function mZ(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 Iu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xf(e,t,n){const r=Ma(e),s=Ma(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}}T5.peek=gZ;function T5(e,t,n,r){const s=mZ(n),l=n.enter("emphasis"),a=n.createTracker(r),u=a.move(s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),p=Xf(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(h=Iu(d)+h.slice(1));const m=h.charCodeAt(h.length-1),_=Xf(r.after.charCodeAt(0),m,s);_.inside&&(h=h.slice(0,-1)+Iu(m));const y=a.move(s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+h+y}function gZ(e,t,n){return n.options.emphasis||"*"}function vZ(e,t){let n=!1;return D0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Py}),!!((!e.depth||e.depth<3)&&k0(e)&&(t.options.setext||n))}function _Z(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(vZ(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:`
|
|
524
|
+
`,after:`
|
|
525
|
+
`});return m(),p(),_+`
|
|
526
|
+
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
527
|
+
`))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");l.move(a+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
528
|
+
`,...l.current()});return/^[\t ]/.test(d)&&(d=Iu(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),h(),u(),d}M5.peek=yZ;function M5(e){return e.value||""}function yZ(){return"<"}N5.peek=bZ;function N5(e,t,n,r){const s=L0(n),l=s==='"'?"Quote":"Apostrophe",a=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${l}`),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(")"),a(),d}function bZ(){return"!"}A5.peek=xZ;function A5(e,t,n,r){const s=e.referenceType,l=n.enter("imageReference");let a=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+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=p,l(),s==="full"||!d||d!==m?h+=u.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function xZ(){return"!"}D5.peek=SZ;function D5(e,t,n){let r=e.value||"",s="`",l=-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+" ");++l<n.unsafe.length;){const a=n.unsafe[l],u=n.compilePattern(a);let h;if(a.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 SZ(){return"`"}function O5(e,t){const n=k0(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))}L5.peek=wZ;function L5(e,t,n,r){const s=L0(n),l=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,h;if(O5(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),u(),n.stack=p,m}u=n.enter("link"),h=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(e,{before:d,after:"](",...a.current()})),d+=a.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(e.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(h=n.enter("destinationRaw"),d+=a.move(n.safe(e.url,{before:d,after:e.title?" ":")",...a.current()}))),h(),e.title&&(h=n.enter(`title${l}`),d+=a.move(" "+s),d+=a.move(n.safe(e.title,{before:d,after:s,...a.current()})),d+=a.move(s),h()),d+=a.move(")"),u(),d}function wZ(e,t,n){return O5(e,n)?"<":"["}j5.peek=CZ;function j5(e,t,n,r){const s=e.referenceType,l=n.enter("linkReference");let a=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+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=p,l(),s==="full"||!d||d!==m?h+=u.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function CZ(){return"["}function j0(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 kZ(e){const t=j0(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 EZ(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 z5(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 RZ(e,t,n,r){const s=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?EZ(n):j0(n);const u=e.ordered?a==="."?")":".":kZ(n);let h=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.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),z5(n)===a&&p){let m=-1;for(;++m<e.children.length;){const _=e.children[m];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(a=u),n.bulletCurrent=a;const d=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,s(),d}function TZ(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 MZ(e,t,n,r){const s=TZ(n);let l=n.bulletCurrent||j0(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(l+" ".repeat(a-l.length)),u.shift(a);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return h(),d;function p(m,_,y){return _?(y?"":" ".repeat(a))+m:(y?l:l+" ".repeat(a-l.length))+m}}function NZ(e,t,n,r){const s=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),s(),a}const AZ=Pp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function DZ(e,t,n,r){return(e.children.some(function(a){return AZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}P5.peek=LZ;function P5(e,t,n,r){const s=OZ(n),l=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),p=Xf(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(h=Iu(d)+h.slice(1));const m=h.charCodeAt(h.length-1),_=Xf(r.after.charCodeAt(0),m,s);_.inside&&(h=h.slice(0,-1)+Iu(m));const y=a.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+h+y}function LZ(e,t,n){return n.options.strong||"*"}function jZ(e,t,n,r){return n.safe(e.value,r)}function zZ(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 PZ(e,t,n){const r=(z5(n)+(n.options.ruleSpaces?" ":"")).repeat(zZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const B5={blockquote:oZ,break:dE,code:hZ,definition:pZ,emphasis:T5,hardBreak:dE,heading:_Z,html:M5,image:N5,imageReference:A5,inlineCode:D5,link:L5,linkReference:j5,list:RZ,listItem:MZ,paragraph:NZ,root:DZ,strong:P5,text:jZ,thematicBreak:PZ};function BZ(){return{enter:{table:IZ,tableData:hE,tableHeader:hE,tableRow:FZ},exit:{codeText:UZ,table:HZ,tableData:o_,tableHeader:o_,tableRow:o_}}}function IZ(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 HZ(e){this.exit(e),this.data.inTable=void 0}function FZ(e){this.enter({type:"tableRow",children:[]},e)}function o_(e){this.exit(e)}function hE(e){this.enter({type:"tableCell",children:[]},e)}function UZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$Z));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $Z(e,t){return t==="|"?t:e}function WZ(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
529
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:a,tableCell:h,tableRow:u}};function a(y,S,w,C){return d(p(y,w,C),y.align)}function u(y,S,w,C){const k=m(y,w,C),T=d([k]);return T.slice(0,T.indexOf(`
|
|
530
|
+
`))}function h(y,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(y,{...C,before:l,after:l});return T(),k(),R}function d(y,S){return iZ(y,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function p(y,S,w){const C=y.children;let k=-1;const T=[],R=S.enter("table");for(;++k<C.length;)T[k]=m(C[k],S,w);return R(),T}function m(y,S,w){const C=y.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=h(C[k],y,S,w);return R(),T}function _(y,S,w){let C=B5.inlineCode(y,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function VZ(){return{exit:{taskListCheckValueChecked:fE,taskListCheckValueUnchecked:fE,paragraph:KZ}}}function qZ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GZ}}}function fE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function KZ(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 l=-1,a;for(;++l<s.length;){const u=s[l];if(u.type==="paragraph"){a=u;break}}a===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 GZ(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);l&&u.move(a);let h=B5.listItem(e,t,n,{...r,...u.current()});return l&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(p){return p+a}}function YZ(){return[RX(),GX(),QX(),BZ(),VZ()]}function XZ(e){return{extensions:[TX(),YX(e),JX(),WZ(e),qZ()]}}const ZZ={tokenize:rQ,partial:!0},I5={tokenize:iQ,partial:!0},H5={tokenize:sQ,partial:!0},F5={tokenize:oQ,partial:!0},QZ={tokenize:lQ,partial:!0},U5={name:"wwwAutolink",tokenize:tQ,previous:W5},$5={name:"protocolAutolink",tokenize:nQ,previous:V5},ys={name:"emailAutolink",tokenize:eQ,previous:q5},Oi={};function JZ(){return{text:Oi}}let Uo=48;for(;Uo<123;)Oi[Uo]=ys,Uo++,Uo===58?Uo=65:Uo===91&&(Uo=97);Oi[43]=ys;Oi[45]=ys;Oi[46]=ys;Oi[95]=ys;Oi[72]=[ys,$5];Oi[104]=[ys,$5];Oi[87]=[ys,U5];Oi[119]=[ys,U5];function eQ(e,t,n){const r=this;let s,l;return a;function a(m){return!Fy(m)||!q5.call(r,r.previous)||z0(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return Fy(m)?(e.consume(m),u):m===64?(e.consume(m),h):n(m)}function h(m){return m===46?e.check(QZ,p,d)(m):m===45||m===95||zn(m)?(l=!0,e.consume(m),h):p(m)}function d(m){return e.consume(m),s=!0,h}function p(m){return l&&s&&Vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function tQ(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!W5.call(r,r.previous)||z0(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ZZ,e.attempt(I5,e.attempt(H5,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function nQ(e,t,n){const r=this;let s="",l=!1;return a;function a(m){return(m===72||m===104)&&V5.call(r,r.previous)&&!z0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(Vn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(m),h}return n(m)}function h(m){return m===47?(e.consume(m),l?d:(l=!0,h)):n(m)}function d(m){return m===null||Kf(m)||wt(m)||ol(m)||Lp(m)?n(m):e.attempt(I5,e.attempt(H5,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function rQ(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function iQ(e,t,n){let r,s,l;return a;function a(d){return d===46||d===95?e.check(F5,h,u)(d):d===null||wt(d)||ol(d)||d!==45&&Lp(d)?h(d):(l=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),a}function h(d){return s||r||!l?n(d):t(d)}}function sQ(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(F5,t,l)(a):a===null||wt(a)||ol(a)?t(a):(e.consume(a),s)}function l(a){return a===41&&r++,e.consume(a),s}}function oQ(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),l):u===93?(e.consume(u),s):u===60||u===null||wt(u)||ol(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||wt(u)||ol(u)?t(u):r(u)}function l(u){return Vn(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):Vn(u)?(e.consume(u),a):n(u)}}function lQ(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return zn(l)?n(l):t(l)}}function W5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function V5(e){return!Vn(e)}function q5(e){return!(e===47||Fy(e))}function Fy(e){return e===43||e===45||e===46||e===95||zn(e)}function z0(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 aQ={tokenize:gQ,partial:!0};function cQ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fQ,continuation:{tokenize:pQ},exit:mQ}},text:{91:{name:"gfmFootnoteCall",tokenize:hQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uQ,resolveTo:dQ}}}}function uQ(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){a=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(!a||!a._balanced)return n(h);const d=ii(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function dQ(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 l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function hQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(l>999||m===93&&!a||m===null||m===91||wt(m))return n(m);if(m===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(ii(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return wt(m)||(a=!0),l++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function fQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,u;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(a>999||S===93&&!u||S===null||S===91||wt(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=ii(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return wt(S)||(u=!0),a++,e.consume(S),S===92?m:p}function m(S){return S===91||S===92||S===93?(e.consume(S),a++,p):p(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(l)||s.push(l),st(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function pQ(e,t,n){return e.check(sd,t,e.attempt(aQ,t,n))}function mQ(e){e.exit("gfmFootnoteDefinition")}function gQ(e,t,n){const r=this;return st(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function vQ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let h=-1;for(;++h<a.length;)if(a[h][0]==="enter"&&a[h][1].type==="strikethroughSequenceTemporary"&&a[h][1]._close){let d=h;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[h][1].end.offset-a[h][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[h][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[h][1].end)},m={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[h][1].start)},_=[["enter",p,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",m,u]],y=u.parser.constructs.insideSpan.null;y&&Cr(_,_.length,0,jp(y,a.slice(d+1,h),u)),Cr(_,_.length,0,[["exit",m,u],["enter",a[h][1],u],["exit",a[h][1],u],["exit",p,u]]),Cr(a,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<a.length;)a[h][1].type==="strikethroughSequenceTemporary"&&(a[h][1].type="data");return a}function l(a,u,h){const d=this.previous,p=this.events;let m=0;return _;function _(S){return d===126&&p[p.length-1][1].type!=="characterEscape"?h(S):(a.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const w=Ma(d);if(S===126)return m>1?h(S):(a.consume(S),m++,y);if(m<2&&!n)return h(S);const C=a.exit("strikethroughSequenceTemporary"),k=Ma(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class _Q{constructor(){this.map=[]}add(t,n,r){yQ(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[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 l of s)t.push(l);s=r.pop()}this.map.length=0}}function yQ(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 bQ(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 l=r.length-1;r[l]=r[l]==="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 xQ(){return{flow:{null:{name:"table",tokenize:SQ,resolveAll:wQ}}}}function SQ(e,t,n){const r=this;let s=0,l=0,a;return u;function u(P){let W=r.events.length-1;for(;W>-1;){const U=r.events[W][1].type;if(U==="lineEnding"||U==="linePrefix")W--;else break}const I=W>-1?r.events[W][1].type:null,$=I==="tableHead"||I==="tableRow"?D:h;return $===D&&r.parser.lazy[r.now().line]?n(P):$(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(a=!0,l+=1),p(P)}function p(P){return P===null?n(P):ze(P)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),y):n(P):Je(P)?st(e,p,"whitespace")(P):(l+=1,a&&(a=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),m(P)))}function m(P){return P===null||P===124||wt(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?_:m)}function _(P){return P===92||P===124?(e.consume(P),m):m(P)}function y(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),a=!1,Je(P)?st(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?C(P):P===124?(a=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):O(P)}function w(P){return Je(P)?st(e,C,"whitespace")(P):C(P)}function C(P){return P===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):P===45?(l+=1,k(P)):P===null||ze(P)?M(P):O(P)}function k(P){return P===45?(e.enter("tableDelimiterFiller"),T(P)):O(P)}function T(P){return P===45?(e.consume(P),T):P===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(P))}function R(P){return Je(P)?st(e,M,"whitespace")(P):M(P)}function M(P){return P===124?S(P):P===null||ze(P)?!a||s!==l?O(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):O(P)}function O(P){return n(P)}function D(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||ze(P)?(e.exit("tableRow"),t(P)):Je(P)?st(e,j,"whitespace")(P):(e.enter("data"),F(P))}function F(P){return P===null||P===124||wt(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?G:F)}function G(P){return P===92||P===124?(e.consume(P),F):F(P)}}function wQ(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],a=[0,0,0,0],u=!1,h=0,d,p,m;const _=new _Q;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(u=!1,h!==0&&(pE(_,t,h,d,p),p=void 0,h=0),d={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",d,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,m=void 0,l=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],m=Gh(_,t,l,s,void 0,m),l=[0,0,0,0]),a[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],m=Gh(_,t,l,s,void 0,m)),l=a,a=[l[1],n,0,0])):S.type==="tableHead"?(u=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,l[1]!==0?(a[0]=a[1],m=Gh(_,t,l,s,n,m)):a[1]!==0&&(m=Gh(_,t,a,s,n,m)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(a[3]=n)}for(h!==0&&pE(_,t,h,d,p),_.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=bQ(t.events,n))}return e}function Gh(e,t,n,r,s,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},da(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const h=da(t.events,n[1]);if(l={type:a,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=da(t.events,n[2]),p=da(t.events,n[3]),m={type:u,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const _=t.events[n[2]],y=t.events[n[3]];if(_[1].end=Object.assign({},y[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(l.end=Object.assign({},da(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function pE(e,t,n,r,s){const l=[],a=da(t.events,n);s&&(s.end=Object.assign({},a),l.push(["exit",s,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function da(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CQ={name:"tasklistCheck",tokenize:EQ};function kQ(){return{text:{91:CQ}}}function EQ(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"),l)}function l(h){return wt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),a):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),a):n(h)}function a(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return ze(h)?t(h):Je(h)?e.check({tokenize:RQ},t,n)(h):n(h)}}function RQ(e,t,n){return st(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function TQ(e){return r5([JZ(),cQ(),vQ(e),xQ(),kQ()])}const MQ={};function ad(e){const t=this,n=e||MQ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(TQ(n)),l.push(YZ()),a.push(XZ(n))}function NQ({content:e}){return g.jsx("div",{className:"flex gap-2 justify-end",children:g.jsx("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:g.jsx(ld,{remarkPlugins:[ad],components:Dp(),children:e})})})}function AQ({json:e}){return g.jsx("div",{className:"flex gap-3 justify-start",children:g.jsx("div",{className:"flex-1 max-w-[90%]",children:g.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 K5({title:e,count:t,children:n,badge:r}){const[s,l]=b.useState(!1);return t===0?null:g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>l(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(ds,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:e}),g.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&g.jsx("div",{className:"ml-5",children:n})]})}function l_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:g.jsx(K5,{title:e,count:t.length,children:g.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>g.jsx(zA,{icon:r?r(s):n,children:s},s))})})}function DQ(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function G5({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return g.jsx("span",{className:ye("inline-block h-2 w-2 rounded-full shrink-0",t)})}function OQ(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 mE({server:e}){const[t,n]=b.useState(!1),r=e.status==="connected";return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:ye("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&g.jsx(ds,{className:ye("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx(G5,{status:e.status}),g.jsx("span",{className:"text-muted-foreground font-medium",children:w_(e.name)}),r?g.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):g.jsx("span",{className:"text-muted-foreground/50",children:OQ(e.status)})]}),!r&&e.error&&g.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>g.jsx(zA,{icon:jA(`mcp__${e.name}__${s}`),children:s},s))})]})}function LQ({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?g.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[g.jsx(G5,{status:"failed"}),g.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return g.jsx(K5,{title:"MCP Servers",count:e.length,badge:r,children:g.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>g.jsx(mE,{server:s},s.name)),n.map(s=>g.jsx(mE,{server:s},s.name))]})})}function jQ({rawJson:e}){const[t,n]=b.useState(!1);return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(ds,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&g.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 zQ({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=b.useMemo(()=>{const s=new Map,l=[];for(const u of e.tools){const h=DQ(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else l.push(u)}const a=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:l,mcpServersWithTools:a}},[e.tools,e.mcpServers]);return g.jsx(go,{children:g.jsxs(Np,{expandedContent:g.jsx(Ap,{className:"my-4 text-xs",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(OV,{children:e.model}),g.jsx(l_,{title:"Tools",items:n,getIcon:s=>wy[s]??LA}),g.jsx(l_,{title:"Agents",items:e.agents,icon:gb}),g.jsx(l_,{title:"Commands",items:e.slashCommands,icon:WP}),g.jsx(LQ,{servers:r}),t&&g.jsx(jQ,{rawJson:t})]})}),children:[g.jsx(k6,{className:"h-5 w-5 text-logo"}),g.jsx(ho,{children:"Session Started"})]})})}function PQ({message:e}){return g.jsx(go,{className:"hidden",children:g.jsxs(Np,{expandedContent:g.jsx(Ap,{className:"my-4 text-xs",children:g.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:[g.jsx("div",{className:"size-5 flex justify-center items-center ",children:g.jsx(gb,{className:"h-4 w-4 text-muted-foreground"})}),g.jsx(ho,{children:"Account"})]})})}function BQ({message:e}){return g.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:g.jsx(ld,{remarkPlugins:[ad],components:Dp(),children:e.text})})}function IQ({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const l=r&&t>0;return g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.jsxs("div",{className:"relative",children:[g.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:[l?g.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:g.jsx(P6,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?g.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:g.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function gE({label:e,description:t}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-foreground text-sm",children:e}),t&&g.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function Y5({selected:e,multiSelect:t,onClick:n}){return g.jsx("button",{type:"button",onClick:n,className:ye("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&&g.jsx(ao,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function HQ({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const l="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",a=s?"":"border-b border-border";return r?g.jsx("button",{onClick:r,className:ye(l,a,"transition-all cursor-pointer"),children:g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx(gE,{label:e.label,description:e.description})}),g.jsx(Y5,{selected:t,multiSelect:n})]})}):g.jsx("div",{className:ye(l,a),children:g.jsx(gE,{label:e.label,description:e.description})})}function FQ(e){return e==null?void 0:e.answers}function ei(e){return e.id||e.question}function UQ({message:e,onSubmit:t,isLatest:n}){var B,q;const r=e.input.questions,s=!!e.result,l=FQ(e.result),a=((B=e.result)==null?void 0:B.discarded)===!0,[u,h]=b.useState(0),[d,p]=b.useState({}),[m,_]=b.useState({}),[y,S]=b.useState(l??null),[w,C]=b.useState(s),k=(V,Z)=>{var oe;const N=(oe=m[V])==null?void 0:oe.trim(),z=d[V]||"",Y=Z||r.find(fe=>ei(fe)===V);if(Y!=null&&Y.multiSelect)return[z,N].filter(Boolean).flatMap(fe=>fe.split(", ").filter(Boolean));const A=N||z;return A?[A]:[]},T=V=>{const Z=d[ei(V)]||"";return V.multiSelect?Z.split(", ").filter(Boolean):[Z]},R=(V,Z)=>{const N=ei(V);if(V.multiSelect){const z=d[N]?d[N].split(", ").filter(Boolean):[],Y=z.includes(Z)?z.filter(A=>A!==Z):[...z,Z];p({...d,[N]:Y.join(", ")})}else p({...d,[N]:Z}),_({...m,[N]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},M=(V,Z)=>{const N=ei(V);_({...m,[N]:Z}),Z&&!V.multiSelect&&p({...d,[N]:""})},O=V=>{const Z=ei(V);V.multiSelect&&m[Z]&&_({...m,[Z]:""})},D=r.every(V=>k(ei(V),V).length>0),j=r[u],F=u===r.length-1,G=j&&k(ei(j),j).length>0,P=()=>{u<r.length-1&&h(u+1)},W=()=>{u>0&&h(u-1)},I=()=>{if(!D)return;const V={};for(const Z of r){const N=ei(Z);V[N]=k(N,Z)}S(V),C(!0),t(e.toolId,r,V)},$=V=>{if(V.key==="Enter"&&!(!j||!G)){if(V.preventDefault(),F){I();return}P()}};if(w||s){const V=l||y||{};return g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.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:[g.jsxs("p",{children:["Question",r.length!==1?"s":""]}),g.jsx("p",{className:"",children:a?"Discarded":"Answers"})]}),r.map((Z,N)=>{const z=V[ei(Z)]||V[Z.question]||[],Y=N===r.length-1;return g.jsxs("div",{className:ye("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Y&&"border-b border-border"),children:[g.jsx("div",{className:"text-sm text-pretty",children:Z.question}),z.length>0&&g.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:z.join(", ")}),z.length===0&&g.jsx("div",{className:"text-sm font-medium text-right italic",children:a?"Discarded":"No Response"})]},ei(Z))})]})})}if(!n)return g.jsx("div",{className:"w-full py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(eT,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!j)return null;const U=T(j),H=m[ei(j)]||"";return g.jsxs("div",{className:"w-full space-y-3",children:[g.jsxs(IQ,{question:j.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?W:void 0,children:[(q=j.options)==null?void 0:q.map(V=>g.jsx(HQ,{option:V,selected:U.includes(V.label),multiSelect:j.multiSelect,onClick:()=>R(j,V.label)},V.label)),g.jsx("div",{className:"transition-all bg-background",children:g.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[g.jsx("input",{type:"text",value:H,onChange:V=>M(j,V.target.value),onKeyDown:$,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),g.jsx(Y5,{selected:!!H,multiSelect:j.multiSelect,onClick:j.multiSelect&&H?()=>O(j):void 0})]})})]}),g.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!F&&G&&(j.multiSelect||!!H)&&g.jsx(rt,{size:"sm",onClick:P,children:"Next"}),F&&g.jsx(rt,{size:"sm",onClick:I,disabled:!D,className:ye(!D&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function $Q({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,l]=b.useState(!1),[a,u]=b.useState(!1),[h,d]=b.useState(!1),[p,m]=b.useState(""),_=b.useRef(null),y=e.input;b.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const S=async()=>{y!=null&&y.plan&&(await navigator.clipboard.writeText(y.plan),u(!0),setTimeout(()=>u(!1),2e3))},w=r?e.result:null,C=(w==null?void 0:w.discarded)===!0;return g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(y==null?void 0:y.plan)&&g.jsx(rt,{variant:"ghost",size:"icon",className:ye("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",!a&&"hover:text-foreground",a&&"hover:!bg-transparent hover:!border-transparent"),onClick:S,children:a?g.jsx(ao,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})}),g.jsxs("div",{className:ye("!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",r&&!s?"max-h-[min(400px,40vh)] ":"",r?"hover:!pb-[32px]":""),children:[r&&g.jsxs(rt,{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(!s),children:[s?"Show Less":"Show More",g.jsx(ub,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),y!=null&&y.plan?g.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[g.jsx(ld,{remarkPlugins:[ad],components:Dp(),children:y.plan}),g.jsx("div",{className:"mt-5"})]}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),r?g.jsx("div",{className:"flex justify-end mx-2",children:g.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:[g.jsx("em",{children:C?"Discarded":w!=null&&w.clearContext?"Approved & Cleared Context":w!=null&&w.confirmed?"Approved":w!=null&&w.message?`Adjusted: "${w.message}"`:"Adjusted Plan"}),g.jsx(J6,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?g.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&g.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[g.jsxs(rt,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[g.jsx(A6,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),g.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[g.jsxs(rt,{size:"sm",variant:"outline",onClick:()=>d(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[g.jsx(nT,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),g.jsxs(rt,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[g.jsx(ao,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),h&&g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx("textarea",{ref:_,value:p,onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&p.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,p.trim())),k.key==="Escape"&&(d(!1),m(""))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full rounded-2xl border border-border bg-muted dark:bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),g.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[g.jsx(rt,{size:"sm",variant:"ghost",onClick:()=>{d(!1),m("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),g.jsxs(rt,{size:"sm",disabled:!p.trim(),onClick:()=>t(e.toolId,!1,void 0,p.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[g.jsx(BP,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):g.jsx("div",{className:"flex justify-end mx-2",children:g.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const WQ={completed:{Icon:ao,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Mi,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:W6,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function VQ({message:e}){const t=e.input.todos;return t.length?g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.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:[g.jsx(gP,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),g.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:l,iconClass:a,textClass:u}=WQ[n.status];return g.jsxs("div",{className:ye("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[g.jsx(l,{className:ye("h-4 w-4 flex-shrink-0",a)}),g.jsx("span",{className:ye("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function qQ(e){const t=e.split(`
|
|
531
|
+
`),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 KQ(e){return e.replace(/<[^>]+>/g,"")}function GQ(e,t){const n=e.split(`
|
|
532
|
+
`),r=t.split(`
|
|
533
|
+
`),s=YQ(n,r),l=XQ(n,r,s);return ZQ(l)}function YQ(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let l=1;l<=n;l++)for(let a=1;a<=r;a++)s[l][a]=e[l-1]===t[a-1]?s[l-1][a-1]+1:Math.max(s[l-1][a],s[l][a-1]);return s}function XQ(e,t,n){const r=[];let s=e.length,l=t.length;for(;s>0||l>0;)s>0&&l>0&&e[s-1]===t[l-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:l}),s--,l--):l>0&&(s===0||n[s][l-1]>=n[s-1][l])?(r.push({type:"added",text:t[l-1],oldIdx:s,newIdx:l}),l--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:l}),s--);return r.reverse()}function ZQ(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function a_({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=b.useMemo(()=>t&&n!==void 0&&r!==void 0?GQ(n,r):[],[t,n,r]),l=b.useMemo(()=>t?[]:qQ(e),[e,t]),a=b.useMemo(()=>l.some(u=>u.lineNumber!==null),[l]);return t&&s.length>0?g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.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":"",p=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return g.jsxs("tr",{className:d,children:[g.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"?"+":" "}),g.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${p}`,children:u.content.slice(1)})]},h)})})})})}):g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.jsx("tbody",{children:l.map((u,h)=>g.jsxs("tr",{children:[a&&g.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:""}),g.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:KQ(u.content)})]},h))})})})})}function X5({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,l=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 w=e.input.pattern,C=e.input.outputMode;return C==="count"?`Count \`${w}\` occurrences`:C==="content"?`Find \`${w}\` in text`:`Find \`${w}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?c8(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${Iv(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${Iv(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${Iv(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${w_(e.input.tool)} from ${w_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),a=b.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=b.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),h=e.toolKind==="bash",d=e.toolKind==="write_file",p=e.toolKind==="edit_file",m=e.toolKind==="read_file",_=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 w=e.result.content;if(typeof w=="string")return w}return JSON.stringify(e.result,null,2)},[e.result]),y=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 g.jsx(go,{className:"w-full",children:g.jsxs(Np,{expandedContent:g.jsx(Ap,{className:"my-4 text-sm",children:g.jsxs("div",{className:"flex flex-col gap-2",children:[p?g.jsx(a_,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!m&&!d&&g.jsx(b2,{label:h?g.jsxs("span",{className:"flex items-center gap-2 w-full",children:[g.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&g.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&g.jsx("span",{className:"text-muted-foreground",children:"background"})]}):d?"Contents":"Input",copyText:y,children:y}),r&&m&&!e.isError&&g.jsx(a_,{content:_}),d&&!e.isError&&g.jsx(a_,{content:e.input.content}),r&&!m&&!(d&&!e.isError)&&!(p&&!e.isError)&&g.jsx(b2,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return g.jsx(za,{className:"size-4 text-destructive"});if(a)return g.jsx(gb,{className:"size-4 text-muted-icon"});const w=jA(e.toolName);return g.jsx(w,{className:"size-4 text-muted-icon"})})()}),g.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:g.jsx(_p,{animate:s,shimmerWidth:Math.max(20,(((S=u||l)==null?void 0:S.length)??33)*3),children:u||l})})]})})}function QQ({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),l=Math.floor(r%3600/60),a=r%60;return s>0?`${s}h${l>0?` ${l}m`:""}`:l>0?`${l}m${a>0?` ${a}s`:""}`:`${a}s`};return e.success?g.jsxs(go,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[g.jsx("div",{className:"w-full h-[1px] bg-border"}),g.jsxs(ho,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),g.jsx("div",{className:"w-full h-[1px] bg-border"})]}):g.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 JQ({message:e}){return g.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:g.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:[g.jsx(U6,{className:"h-4 w-4 ml-1.5"}),g.jsx("em",{children:"Interrupted"})]})})}function Zf({size:e=4}){return g.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[g.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:g.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"}})}),g.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function eJ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Zf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),g.jsx(Zf,{})]})}function tJ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Zf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),g.jsx(Zf,{})]})}function nJ({message:e}){return g.jsx(go,{children:g.jsxs(Np,{expandedContent:g.jsx(Ap,{className:"my-4 text-xs",children:g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:g.jsx(ld,{remarkPlugins:[ad],components:Dp(),children:e.summary})})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(tT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(ho,{children:"Summarized"})]})})}const rJ={compacting:"Compacting..."};function iJ({message:e}){const t=rJ[e.status]||e.status;return g.jsxs(go,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(tT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(ho,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const sJ={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"}},oJ={key:"other",singular:"tool call",plural:"tool calls"};function lJ(e){return sJ[e]??oJ}function aJ(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,l=lJ(s),a=t.get(l.key);a?a.count++:(t.set(l.key,{category:l,count:1}),n.push(l.key))}return n.map(r=>{const{category:s,count:l}=t.get(r);return`${l} ${l===1?s.singular:s.plural}`}).join(", ")}function cJ({messages:e,isLoading:t,localPath:n}){const[r,s]=b.useState(!1),l=b.useMemo(()=>aJ(e),[e]),u=e.some(h=>h.result===void 0)&&t;return g.jsx(go,{className:"w-full",children:g.jsxs("div",{className:"flex flex-col w-full",children:[g.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:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(ds,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),g.jsx(ho,{className:"text-left",children:g.jsx(_p,{animate:u,children:l})})]})}),r&&g.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>g.jsx(X5,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&g.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:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(ds,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),g.jsx(ho,{className:"text-left",children:"Collapse"})]})})]})]})})}const uJ=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function vE(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!uJ.has(t)}function dJ(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(vE(r)){const s=[r],l=n;for(n+=1;n<e.length&&vE(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:l}):t.push({type:"single",message:r,index:l});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function hJ({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:l,onExitPlanModeConfirm:a}){const u=b.useMemo(()=>dJ(e),[e]);function h(d,p){if(d.kind==="user_prompt")return g.jsx(NQ,{content:d.content},d.id);switch(d.kind){case"unknown":return g.jsx(AQ,{json:d.json},d.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===p?g.jsx(zQ,{message:d,rawJson:d.debugRaw},d.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===p?g.jsx(PQ,{message:d},d.id):null;case"assistant_text":return g.jsx(BQ,{message:d},d.id);case"tool":return d.toolKind==="ask_user_question"?g.jsx(UQ,{message:d,onSubmit:l,isLatest:d.id===r.AskUserQuestion},d.id):d.toolKind==="exit_plan_mode"?g.jsx($Q,{message:d,onConfirm:a,isLatest:d.id===r.ExitPlanMode},d.id):d.toolKind==="todo_write"?d.id!==r.TodoWrite?null:g.jsx(VQ,{message:d},d.id):g.jsx(X5,{message:d,isLoading:t,localPath:n},d.id);case"result":{const m=e[p+1],_=e[p-1];return(m==null?void 0:m.kind)==="context_cleared"||(_==null?void 0:_.kind)==="context_cleared"?null:g.jsx(QQ,{message:d},d.id)}case"interrupted":return g.jsx(JQ,{message:d},d.id);case"compact_boundary":return g.jsx(eJ,{},d.id);case"context_cleared":return g.jsx(tJ,{},d.id);case"compact_summary":return g.jsx(nJ,{message:d},d.id);case"status":return p===e.length-1?g.jsx(iJ,{message:d},d.id):null}}return g.jsx(AV,{onOpenLocalLink:s,children:u.map(d=>{if(d.type==="tool-group")return g.jsx("div",{className:"group relative",[Cf]:"",children:g.jsx(cJ,{messages:d.messages,isLoading:t,localPath:n})},`group-${d.startIndex}`);const p=h(d.message,d.index);return p?g.jsx("div",{id:`msg-${d.message.id}`,className:"group relative",[Cf]:"",children:p},d.message.id):null})})}function fJ({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){b.useEffect(()=>{if(!n)return;let s=0,l=null;const a=m=>{const _=m instanceof Element?m:null,y=e.current,S=t.current;if(kC({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:l,pointerEndTarget:_,root:y,fallback:S,hasActiveOverlay:CC(document),hasActiveSelection:lB(window.getSelection())})!=="restore"){l=null;return}S==null||S.focus({preventScroll:!0}),l=null},u=m=>{cancelAnimationFrame(s),l=m.target instanceof Element?m.target:null},h=m=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{a(m.target)})},d=()=>{l=null;const m=t.current;!m||m.disabled||m.focus({preventScroll:!0})},p=m=>{if(m.key!=="Escape")return;const _=t.current;kC({trigger:"escape",activeElement:document.activeElement,fallback:_,hasActiveOverlay:CC(document),canCancel:r,defaultPrevented:m.defaultPrevented})==="escape-focus"&&(m.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",p,!0),window.addEventListener(wf,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener(wf,d)}},[r,n,t,e])}const Yh="What are we building?",pJ=19,mJ=72,gJ=120;function vJ(){var ie,ce,we,Se,ke,Be;const e=Qy(),t=b.useRef(null),n=b.useRef(null),r=b.useRef(null),[s,l]=b.useState(""),[a,u]=b.useState(!1),[h,d]=b.useState(0),p=((ie=e.runtime)==null?void 0:ie.projectId)??null,_=Js(Ce=>p?Ce.projects[p]:void 0)??qV,S=gf(Ce=>p?Ce.projects[p]:void 0)??FV,w=Js(Ce=>Ce.addTerminal),C=Js(Ce=>Ce.removeTerminal),k=Js(Ce=>Ce.toggleVisibility),T=Js(Ce=>Ce.resetMainSizes),R=Js(Ce=>Ce.setMainSizes),M=Js(Ce=>Ce.setTerminalSizes),O=gf(Ce=>Ce.toggleVisibility),D=gf(Ce=>Ce.setSize),j=Hr(Ce=>Ce.scrollbackLines),F=Hr(Ce=>Ce.minColumnWidth),G=e.keybindings,P=b.useMemo(()=>IA(G),[G]),W=_.terminals.length>0,I=!!(p&&_.isVisible&&W),$=!!(p&&W),U=!!(p&&S.isVisible),H=!!p,{isAnimating:B,mainPanelGroupRef:q,terminalFocusRequestVersion:V,terminalPanelRef:Z,terminalVisualRef:N}=lq({showTerminalPane:I,shouldRenderTerminalLayout:$,projectId:p,terminalLayout:_,chatInputRef:r}),{isAnimating:z,panelGroupRef:Y,sidebarPanelRef:A,sidebarVisualRef:oe}=iq({projectId:p,shouldRenderRightSidebarLayout:H,showRightSidebar:U,rightSidebarSize:S.size});fJ({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((ce=e.runtime)==null?void 0:ce.status)!=="waiting_for_user",canCancel:e.canCancel});const fe=()=>{if(p){if(W){k(p);return}w(p)}},se=Ce=>{var xt;if(!p||!I||B.current)return;const Oe=Ce.chat,bt=Ce.terminal;if(!Number.isFinite(Oe)||!Number.isFinite(bt))return;const hn=((xt=t.current)==null?void 0:xt.getBoundingClientRect().height)??0;if(XV(hn,bt)){T(p),k(p);return}R(p,[Oe,bt])};b.useEffect(()=>{if(e.messages.length!==0)return;l(""),u(!1);let Ce=0;const Oe=window.setInterval(()=>{Ce+=1,l(Yh.slice(0,Ce)),Ce>=Yh.length&&(window.clearInterval(Oe),u(!0))},pJ);return()=>window.clearInterval(Oe)},[e.activeChatId,e.messages.length]),b.useEffect(()=>{function Ce(Oe){if(p){if(Zc(P,"toggleEmbeddedTerminal",Oe)){Oe.preventDefault(),fe();return}if(Zc(P,"toggleRightSidebar",Oe)){Oe.preventDefault(),O(p);return}if(Zc(P,"openInFinder",Oe)){Oe.preventDefault(),e.handleOpenExternal("open_finder");return}if(Zc(P,"openInEditor",Oe)){Oe.preventDefault(),e.handleOpenExternal("open_editor");return}Zc(P,"addSplitTerminal",Oe)&&(Oe.preventDefault(),w(p))}}return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[w,fe,p,P,O,k]),b.useEffect(()=>{const Ce=window.requestAnimationFrame(()=>{e.updateScrollState()}),Oe=window.setTimeout(()=>{e.updateScrollState()},ma);return()=>{window.cancelAnimationFrame(Ce),window.clearTimeout(Oe)}},[$,I,e.updateScrollState]),b.useEffect(()=>{function Ce(){e.updateScrollState()}return window.addEventListener("resize",Ce),()=>window.removeEventListener("resize",Ce)},[e.updateScrollState]),b.useEffect(()=>{const Ce=t.current;if(!Ce||!$)return;const Oe=()=>{const hn=Ce.getBoundingClientRect().height;if(hn<=0)return;const xt=hn*(_.mainSizes[1]/100);xt<=0||d(zt=>Math.abs(zt-xt)<1?zt:xt)},bt=new ResizeObserver(Oe);return bt.observe(Ce),Oe(),()=>bt.disconnect()},[p,$,_.mainSizes]);const J=Ce=>Number.isFinite(Ce)?Math.min(Cy,Math.max(Op,Ce)):S.size,ge=g.jsxs(fN,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[g.jsxs(mN,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[g.jsx(bF,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:I,onToggleEmbeddedTerminal:p?fe:void 0,rightSidebarVisible:U,onToggleRightSidebar:p?()=>O(p):void 0,onOpenExternal:Ce=>{e.handleOpenExternal(Ce)},editorLabel:e.editorLabel,finderShortcut:P.bindings.openInFinder,editorShortcut:P.bindings.openInEditor,terminalShortcut:P.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:P.bindings.toggleRightSidebar}),g.jsxs(PA,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?g.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[g.jsx(hJ,{messages:e.messages,isLoading:e.isProcessing,localPath:(we=e.runtime)==null?void 0:we.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?g.jsx(jV,{status:(Se=e.runtime)==null?void 0:Se.status}):null,e.commandError?g.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),g.jsx("div",{style:{height:250},"aria-hidden":"true"})]}):null]}),e.messages.length===0?g.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:mJ,bottom:e.transcriptPaddingBottom},children:g.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:g.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[g.jsx(pu,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),g.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":Yh,children:g.jsxs("span",{className:"relative inline-grid place-items-start",children:[g.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:Yh}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),g.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:s}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:g.jsx("span",{className:"kanna-typewriter-cursor","data-typing-complete":a?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,g.jsx("div",{style:{bottom:gJ},className:ye("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:g.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-white hover:bg-muted border border-border rounded-full aspect-square cursor-pointer text-sm text-primary hover:text-foreground dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-100 dark:border-slate-600",children:g.jsx(y6,{className:"h-5 w-5"})})})]}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:g.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:g.jsx(gF,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((ke=e.runtime)==null?void 0:ke.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((Be=e.runtime)==null?void 0:Be.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return g.jsx("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:H&&p?g.jsxs(of,{groupRef:Y,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:Ce=>{var bt;if(!U||z.current)return;const Oe=J(Ce.rightSidebar);Math.abs(Oe-Ce.rightSidebar)<.1||(bt=Y.current)==null||bt.setLayout({workspace:100-Oe,rightSidebar:Oe})},onLayoutChanged:Ce=>{!U||z.current||D(p,J(Ce.rightSidebar))},children:[g.jsx(Wo,{id:"workspace",defaultSize:`${100-S.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:$?g.jsxs(of,{groupRef:q,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:se,children:[g.jsx(Wo,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ge}),g.jsx(lf,{withHandle:!0,orientation:"vertical",disabled:!I,className:ye(!I&&"pointer-events-none opacity-0")}),g.jsx(Wo,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:g.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":I?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ma}ms`},children:g.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g.jsx(_2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:j,minColumnWidth:F,splitTerminalShortcut:P.bindings.addSplitTerminal,focusRequestVersion:V,onRemoveTerminal:(Ce,Oe)=>{e.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),C(Ce,Oe)},onTerminalLayout:M})})})})]},p):ge}),g.jsx(lf,{withHandle:!0,orientation:"horizontal",disabled:!U,className:ye(!U&&"pointer-events-none opacity-0")}),g.jsx(Wo,{id:"rightSidebar",defaultSize:`${S.size}%`,maxSize:`${Cy}%`,className:"min-h-0 min-w-0",elementRef:A,children:g.jsx("div",{ref:oe,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":U?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${ma}ms`},children:g.jsx(xF,{onClose:()=>O(p)})})})]},`${p}-right-sidebar`):$&&p?g.jsxs(of,{groupRef:q,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:se,children:[g.jsx(Wo,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ge}),g.jsx(lf,{withHandle:!0,orientation:"vertical",disabled:!I,className:ye(!I&&"pointer-events-none opacity-0")}),g.jsx(Wo,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:g.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":I?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ma}ms`},children:g.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g.jsx(_2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:j,minColumnWidth:F,splitTerminalShortcut:P.bindings.addSplitTerminal,focusRequestVersion:V,onRemoveTerminal:(Ce,Oe)=>{e.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),C(Ce,Oe)},onTerminalLayout:M})})})})]},p):ge})}function _E({narrow:e=!1,title:t,subtitle:n,icon:r=hb}){return g.jsxs("div",{className:ye("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[g.jsxs("div",{className:ye("flex items-center gap-1 mb-2",e&&"justify-center"),children:[g.jsx("div",{className:"p-2 pl-0 rounded-lg",children:g.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&g.jsx("p",{className:ye("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const _J={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function Z5({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:l}){return g.jsx("div",{className:ye("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(a=>{const u=a.value===e,h=a.icon,d=h?b.isValidElement(h)?h:(()=>{const m=h;return g.jsx(m,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,p=g.jsxs("button",{type:"button",onClick:()=>t(a.value),disabled:a.disabled,"aria-pressed":u,className:ye("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",_J[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",a.disabled&&"opacity-50 pointer-events-none",l),children:[d,g.jsx("span",{children:a.label})]},a.value);return a.tooltip?g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:p}),g.jsx(Tu,{children:a.tooltip})]},a.value):p})})}function yJ(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function bJ({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=b.useState("new"),[l,a]=b.useState(""),[u,h]=b.useState(""),d=b.useRef(null),p=b.useRef(null);b.useEffect(()=>{e&&(s("new"),a(""),h(""),setTimeout(()=>{var C;return(C=d.current)==null?void 0:C.focus()},0))},[e]),b.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=d.current)==null||C.focus():(k=p.current)==null||k.focus()},0)},[r,e]);const m=yJ(l),_=m?`${r8}/${m}`:"",y=u.trim(),S=r==="new"?!!m:!!y,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:l.trim()});else{const C=y.split("/").pop()||y;n({mode:"existing",localPath:y,title:C})}t(!1)}};return g.jsx(oT,{open:e,onOpenChange:t,children:g.jsxs(_b,{size:"sm",children:[g.jsxs(cT,{className:"space-y-4",children:[g.jsx(aT,{children:"Add Project"}),g.jsx(Z5,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),r==="new"?g.jsxs("div",{className:"space-y-2",children:[g.jsx(io,{ref:d,type:"text",value:l,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},placeholder:"Project name"}),_&&g.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):g.jsxs("div",{className:"space-y-2",children:[g.jsx(io,{ref:p,type:"text",value:u,onChange:C=>h(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},placeholder:"~/Projects/my-app"}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),g.jsxs(uT,{children:[g.jsx(rt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),g.jsx(rt,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function xJ({text:e}){const[t,n]=b.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return g.jsx(rt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?g.jsx(ao,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})}function yE({children:e}){return g.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:[g.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[g.jsx(ds,{className:"inline h-4 w-4 opacity-40"}),g.jsx("code",{children:e})]}),g.jsx(xJ,{text:e})]})}function Xh({children:e}){return g.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function c_({children:e}){return g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function u_({icon:e,title:t,subtitle:n,iconClassName:r}){return g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:g.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),g.jsx("span",{className:"text-sm font-medium",children:t}),g.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function bE(){return g.jsx(x6,{className:"h-4 w-4 text-muted-foreground"})}function xE({number:e,title:t,children:n}){return g.jsx("div",{className:"flex gap-4",children:g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[g.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),g.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),g.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function SJ({localPath:e,loading:t,onClick:n}){return g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.jsxs("button",{className:ye("border border-border hover:border-primary/30 group rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",t&&"opacity-50 cursor-not-allowed"),disabled:t,onClick:n,children:[g.jsx(dP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:KT(e)}),t?g.jsx(Mi,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):g.jsx(pb,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),g.jsx(Tu,{children:g.jsx("p",{children:e})})]})}function wJ({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:l,onCreateProject:a}){const[u,h]=b.useState(!1),d=b.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),p=e==="connecting"||!t,m=e==="connected"&&t;return g.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[m?g.jsxs(g.Fragment,{children:[g.jsx(_E,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${$n} is connected, choose a project below to get started.`}),g.jsxs("div",{className:"w-full px-6 mb-10",children:[g.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),g.jsxs(rt,{variant:"default",size:"sm",onClick:()=>h(!0),children:[g.jsx(fb,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),d.length>0?g.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:d.map(_=>g.jsx(SJ,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{l(_.localPath)}},_.localPath))}):g.jsx(Xh,{children:g.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?g.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]})]}):g.jsxs(g.Fragment,{children:[g.jsx(_E,{narrow:!0,icon:yC,title:p?`Connecting ${$n}`:`Connect ${$n}`,subtitle:p?`${$n} is starting up and loading your local projects.`:`Run ${$n} directly on your machine with full access to your local files and agent project history.`}),g.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[g.jsx(c_,{children:"Status"}),g.jsx("div",{className:"mb-8",children:g.jsx(Xh,{children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 text-muted-foreground animate-spin"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:p?`Connecting to your local ${$n} server...`:g.jsxs(g.Fragment,{children:["Not connected. Run ",g.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:Ah()})," from any terminal on this machine."]})})]})})}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(c_,{children:"How it works"}),g.jsx(Xh,{children:g.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[g.jsx(u_,{icon:mb,title:`${$n} CLI`,subtitle:"On Your Machine"}),g.jsx(bE,{}),g.jsx(u_,{icon:hb,title:`${$n} Server`,subtitle:"Local WebSocket"}),g.jsx(bE,{}),g.jsx(u_,{icon:yC,title:`${$n} UI`,subtitle:"Project Chat"})]})})]}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(c_,{children:"Setup"}),g.jsx(Xh,{children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs(xE,{number:1,title:`Start ${$n}`,children:[g.jsx("p",{children:"Run this command in your terminal:"}),g.jsx(yE,{children:Ah()})]}),g.jsxs(xE,{number:2,title:"Open the local UI",children:[g.jsxs("p",{children:[$n," serves the app locally and opens the Local Projects page in an app-style browser window."]}),g.jsx(yE,{children:"http://localhost:3210/local"})]}),g.jsxs("div",{className:"mt-8",children:[g.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),g.jsxs("div",{className:"space-y-3 text-sm",children:[g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Ah("").trim()}),g.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Ah("--no-open")}),g.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),g.jsx(bJ,{open:u,onOpenChange:h,onConfirm:_=>{a(_)}}),g.jsx("div",{className:"py-4 text-center",children:g.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Nb.split("/")[1]]})})]})}function CJ(){const e=Qy();return g.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:g.jsx(wJ,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}function SE({children:e,className:t,icon:n,type:r="button",variant:s="outline",...l}){return g.jsxs("button",{type:r,className:ye(sb({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...l,children:[n,g.jsx("span",{children:e})]})}function wE(e,[t,n]){return Math.min(n,Math.max(t,e))}function kJ(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 EJ=[" ","Enter","ArrowUp","ArrowDown"],RJ=[" ","Enter"],ll="Select",[Ip,Hp,TJ]=Fb(ll),[Ga]=ms(ll,[TJ,po]),Fp=po(),[MJ,_o]=Ga(ll),[NJ,AJ]=Ga(ll),Q5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:a,defaultValue:u,onValueChange:h,dir:d,name:p,autoComplete:m,disabled:_,required:y,form:S}=e,w=Fp(t),[C,k]=b.useState(null),[T,R]=b.useState(null),[M,O]=b.useState(!1),D=Ub(d),[j,F]=wa({prop:r,defaultProp:s??!1,onChange:l,caller:ll}),[G,P]=wa({prop:a,defaultProp:u,onChange:h,caller:ll}),W=b.useRef(null),I=C?S||!!C.closest("form"):!0,[$,U]=b.useState(new Set),H=Array.from($).map(B=>B.props.value).join(";");return g.jsx(hp,{...w,children:g.jsxs(MJ,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:M,onValueNodeHasChildrenChange:O,contentId:cs(),value:G,onValueChange:P,open:j,onOpenChange:F,dir:D,triggerPointerDownPosRef:W,disabled:_,children:[g.jsx(Ip.Provider,{scope:t,children:g.jsx(NJ,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(B=>{U(q=>new Set(q).add(B))},[]),onNativeOptionRemove:b.useCallback(B=>{U(q=>{const V=new Set(q);return V.delete(B),V})},[]),children:n})}),I?g.jsxs(wD,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:m,value:G,onChange:B=>P(B.target.value),disabled:_,form:S,children:[G===void 0?g.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};Q5.displayName=ll;var J5="SelectTrigger",eD=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=Fp(n),a=_o(J5,n),u=a.disabled||r,h=ht(t,a.onTriggerChange),d=Hp(n),p=b.useRef("touch"),[m,_,y]=kD(w=>{const C=d().filter(R=>!R.disabled),k=C.find(R=>R.value===a.value),T=ED(C,w,k);T!==void 0&&a.onValueChange(T.value)}),S=w=>{u||(a.onOpenChange(!0),y()),w&&(a.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(Vu,{asChild:!0,...l,children:g.jsx(et.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":CD(a.value)?"":void 0,...s,ref:h,onClick:Re(s.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&S(w)}),onPointerDown:Re(s.onPointerDown,w=>{p.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Re(s.onKeyDown,w=>{const C=m.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&_(w.key),!(C&&w.key===" ")&&EJ.includes(w.key)&&(S(),w.preventDefault())})})})});eD.displayName=J5;var tD="SelectValue",nD=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:a="",...u}=e,h=_o(tD,n),{onValueNodeHasChildrenChange:d}=h,p=l!==void 0,m=ht(t,h.onValueNodeChange);return Pn(()=>{d(p)},[d,p]),g.jsx(et.span,{...u,ref:m,style:{pointerEvents:"none"},children:CD(h.value)?g.jsx(g.Fragment,{children:a}):l})});nD.displayName=tD;var DJ="SelectIcon",rD=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(et.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});rD.displayName=DJ;var OJ="SelectPortal",iD=e=>g.jsx(ja,{asChild:!0,...e});iD.displayName=OJ;var al="SelectContent",sD=b.forwardRef((e,t)=>{const n=_o(al,e.__scopeSelect),[r,s]=b.useState();if(Pn(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?Si.createPortal(g.jsx(oD,{scope:e.__scopeSelect,children:g.jsx(Ip.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),l):null}return g.jsx(lD,{...e,ref:t})});sD.displayName=al;var ri=10,[oD,yo]=Ga(al),LJ="SelectContentImpl",jJ=Qo("SelectContent.RemoveScroll"),lD=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:a,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:C,...k}=e,T=_o(al,n),[R,M]=b.useState(null),[O,D]=b.useState(null),j=ht(t,J=>M(J)),[F,G]=b.useState(null),[P,W]=b.useState(null),I=Hp(n),[$,U]=b.useState(!1),H=b.useRef(!1);b.useEffect(()=>{if(R)return sp(R)},[R]),rp();const B=b.useCallback(J=>{const[ge,...ie]=I().map(Se=>Se.ref.current),[ce]=ie.slice(-1),we=document.activeElement;for(const Se of J)if(Se===we||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&O&&(O.scrollTop=0),Se===ce&&O&&(O.scrollTop=O.scrollHeight),Se==null||Se.focus(),document.activeElement!==we))return},[I,O]),q=b.useCallback(()=>B([F,R]),[B,F,R]);b.useEffect(()=>{$&&q()},[$,q]);const{onOpenChange:V,triggerPointerDownPosRef:Z}=T;b.useEffect(()=>{if(R){let J={x:0,y:0};const ge=ce=>{var we,Se;J={x:Math.abs(Math.round(ce.pageX)-(((we=Z.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((Se=Z.current)==null?void 0:Se.y)??0))}},ie=ce=>{J.x<=10&&J.y<=10?ce.preventDefault():R.contains(ce.target)||V(!1),document.removeEventListener("pointermove",ge),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",ie,{capture:!0})}}},[R,V,Z]),b.useEffect(()=>{const J=()=>V(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[V]);const[N,z]=kD(J=>{const ge=I().filter(we=>!we.disabled),ie=ge.find(we=>we.ref.current===document.activeElement),ce=ED(ge,J,ie);ce&&setTimeout(()=>ce.ref.current.focus())}),Y=b.useCallback((J,ge,ie)=>{const ce=!H.current&&!ie;(T.value!==void 0&&T.value===ge||ce)&&(G(J),ce&&(H.current=!0))},[T.value]),A=b.useCallback(()=>R==null?void 0:R.focus(),[R]),oe=b.useCallback((J,ge,ie)=>{const ce=!H.current&&!ie;(T.value!==void 0&&T.value===ge||ce)&&W(J)},[T.value]),fe=r==="popper"?Uy:aD,se=fe===Uy?{side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:C}:{};return g.jsx(oD,{scope:n,content:R,viewport:O,onViewportChange:D,itemRefCallback:Y,selectedItem:F,onItemLeave:A,itemTextRefCallback:oe,focusSelectedItem:q,selectedItemText:P,position:r,isPositioned:$,searchRef:N,children:g.jsx($u,{as:jJ,allowPinchZoom:!0,children:g.jsx(Uu,{asChild:!0,trapped:T.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Re(s,J=>{var ge;(ge=T.trigger)==null||ge.focus({preventScroll:!0}),J.preventDefault()}),children:g.jsx(La,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:g.jsx(fe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:J=>J.preventDefault(),...k,...se,onPlaced:()=>U(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,J=>{const ge=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ge&&J.key.length===1&&z(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ce=I().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const we=J.target,Se=ce.indexOf(we);ce=ce.slice(Se+1)}setTimeout(()=>B(ce)),J.preventDefault()}})})})})})})});lD.displayName=LJ;var zJ="SelectItemAlignedPosition",aD=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=_o(al,n),a=yo(al,n),[u,h]=b.useState(null),[d,p]=b.useState(null),m=ht(t,j=>p(j)),_=Hp(n),y=b.useRef(!1),S=b.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:T}=a,R=b.useCallback(()=>{if(l.trigger&&l.valueNode&&u&&d&&w&&C&&k){const j=l.trigger.getBoundingClientRect(),F=d.getBoundingClientRect(),G=l.valueNode.getBoundingClientRect(),P=k.getBoundingClientRect();if(l.dir!=="rtl"){const we=P.left-F.left,Se=G.left-we,ke=j.left-Se,Be=j.width+ke,Ce=Math.max(Be,F.width),Oe=window.innerWidth-ri,bt=wE(Se,[ri,Math.max(ri,Oe-Ce)]);u.style.minWidth=Be+"px",u.style.left=bt+"px"}else{const we=F.right-P.right,Se=window.innerWidth-G.right-we,ke=window.innerWidth-j.right-Se,Be=j.width+ke,Ce=Math.max(Be,F.width),Oe=window.innerWidth-ri,bt=wE(Se,[ri,Math.max(ri,Oe-Ce)]);u.style.minWidth=Be+"px",u.style.right=bt+"px"}const W=_(),I=window.innerHeight-ri*2,$=w.scrollHeight,U=window.getComputedStyle(d),H=parseInt(U.borderTopWidth,10),B=parseInt(U.paddingTop,10),q=parseInt(U.borderBottomWidth,10),V=parseInt(U.paddingBottom,10),Z=H+B+$+V+q,N=Math.min(C.offsetHeight*5,Z),z=window.getComputedStyle(w),Y=parseInt(z.paddingTop,10),A=parseInt(z.paddingBottom,10),oe=j.top+j.height/2-ri,fe=I-oe,se=C.offsetHeight/2,J=C.offsetTop+se,ge=H+B+J,ie=Z-ge;if(ge<=oe){const we=W.length>0&&C===W[W.length-1].ref.current;u.style.bottom="0px";const Se=d.clientHeight-w.offsetTop-w.offsetHeight,ke=Math.max(fe,se+(we?A:0)+Se+q),Be=ge+ke;u.style.height=Be+"px"}else{const we=W.length>0&&C===W[0].ref.current;u.style.top="0px";const ke=Math.max(oe,H+w.offsetTop+(we?Y:0)+se)+ie;u.style.height=ke+"px",w.scrollTop=ge-oe+w.offsetTop}u.style.margin=`${ri}px 0`,u.style.minHeight=N+"px",u.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[_,l.trigger,l.valueNode,u,d,w,C,k,l.dir,r]);Pn(()=>R(),[R]);const[M,O]=b.useState();Pn(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const D=b.useCallback(j=>{j&&S.current===!0&&(R(),T==null||T(),S.current=!1)},[R,T]);return g.jsx(BJ,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:D,children:g.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:g.jsx(et.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});aD.displayName=zJ;var PJ="SelectPopperPosition",Uy=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ri,...l}=e,a=Fp(n);return g.jsx(fp,{...a,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});Uy.displayName=PJ;var[BJ,P0]=Ga(al,{}),$y="SelectViewport",cD=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=yo($y,n),a=P0($y,n),u=ht(t,l.onViewportChange),h=b.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(Ip.Slot,{scope:n,children:g.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=a;if(_!=null&&_.current&&m){const y=Math.abs(h.current-p.scrollTop);if(y>0){const S=window.innerHeight-ri*2,w=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),k=Math.max(w,C);if(k<S){const T=k+y,R=Math.min(S,T),M=T-R;m.style.height=R+"px",m.style.bottom==="0px"&&(p.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}h.current=p.scrollTop})})})]})});cD.displayName=$y;var uD="SelectGroup",[IJ,HJ]=Ga(uD),dD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=cs();return g.jsx(IJ,{scope:n,id:s,children:g.jsx(et.div,{role:"group","aria-labelledby":s,...r,ref:t})})});dD.displayName=uD;var hD="SelectLabel",fD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=HJ(hD,n);return g.jsx(et.div,{id:s.id,...r,ref:t})});fD.displayName=hD;var Qf="SelectItem",[FJ,pD]=Ga(Qf),mD=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...a}=e,u=_o(Qf,n),h=yo(Qf,n),d=u.value===r,[p,m]=b.useState(l??""),[_,y]=b.useState(!1),S=ht(t,T=>{var R;return(R=h.itemRefCallback)==null?void 0:R.call(h,T,r,s)}),w=cs(),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 g.jsx(FJ,{scope:n,value:r,disabled:s,textId:w,isSelected:d,onItemTextChange:b.useCallback(T=>{m(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:g.jsx(Ip.ItemSlot,{scope:n,value:r,disabled:s,textValue:p,children:g.jsx(et.div,{role:"option","aria-labelledby":w,"data-highlighted":_?"":void 0,"aria-selected":d&&_,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:S,onFocus:Re(a.onFocus,()=>y(!0)),onBlur:Re(a.onBlur,()=>y(!1)),onClick:Re(a.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Re(a.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Re(a.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:Re(a.onPointerMove,T=>{var R;C.current=T.pointerType,s?(R=h.onItemLeave)==null||R.call(h):C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(a.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=h.onItemLeave)==null||R.call(h))}),onKeyDown:Re(a.onKeyDown,T=>{var M;((M=h.searchRef)==null?void 0:M.current)!==""&&T.key===" "||(RJ.includes(T.key)&&k(),T.key===" "&&T.preventDefault())})})})})});mD.displayName=Qf;var du="SelectItemText",gD=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,a=_o(du,n),u=yo(du,n),h=pD(du,n),d=AJ(du,n),[p,m]=b.useState(null),_=ht(t,k=>m(k),h.onItemTextChange,k=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,k,h.value,h.disabled)}),y=p==null?void 0:p.textContent,S=b.useMemo(()=>g.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=d;return Pn(()=>(w(S),()=>C(S)),[w,C,S]),g.jsxs(g.Fragment,{children:[g.jsx(et.span,{id:h.textId,...l,ref:_}),h.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Si.createPortal(l.children,a.valueNode):null]})});gD.displayName=du;var vD="SelectItemIndicator",_D=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pD(vD,n).isSelected?g.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});_D.displayName=vD;var Wy="SelectScrollUpButton",yD=b.forwardRef((e,t)=>{const n=yo(Wy,e.__scopeSelect),r=P0(Wy,e.__scopeSelect),[s,l]=b.useState(!1),a=ht(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;l(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?g.jsx(xD,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});yD.displayName=Wy;var Vy="SelectScrollDownButton",bD=b.forwardRef((e,t)=>{const n=yo(Vy,e.__scopeSelect),r=P0(Vy,e.__scopeSelect),[s,l]=b.useState(!1),a=ht(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,p=Math.ceil(h.scrollTop)<d;l(p)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?g.jsx(xD,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});bD.displayName=Vy;var xD=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=yo("SelectScrollButton",n),a=b.useRef(null),u=Hp(n),h=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>h(),[h]),Pn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),g.jsx(et.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Re(s.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{h()})})}),UJ="SelectSeparator",SD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});SD.displayName=UJ;var qy="SelectArrow",$J=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Fp(n),l=_o(qy,n),a=yo(qy,n);return l.open&&a.position==="popper"?g.jsx(pp,{...s,...r,ref:t}):null});$J.displayName=qy;var WJ="SelectBubbleInput",wD=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),l=ht(r,s),a=kJ(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(h,"value").set;if(a!==t&&p){const m=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(m)}},[a,t]),g.jsx(et.select,{...n,style:{...OT,...n.style},ref:l,defaultValue:t})});wD.displayName=WJ;function CD(e){return e===""||e===void 0}function kD(e){const t=oi(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(a=>{const u=n.current+a;t(u),(function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(u)},[t]),l=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function ED(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=VJ(e,Math.max(l,0));s.length===1&&(a=a.filter(d=>d!==n));const h=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function VJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qJ=Q5,RD=eD,KJ=nD,GJ=rD,YJ=iD,TD=sD,XJ=cD,ZJ=dD,MD=fD,ND=mD,QJ=gD,JJ=_D,AD=yD,DD=bD,OD=SD;const CE=qJ,kE=ZJ,EE=KJ,Ky=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(RD,{ref:r,className:ye("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,g.jsx(GJ,{asChild:!0,children:g.jsx(ub,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));Ky.displayName=RD.displayName;const LD=b.forwardRef(({className:e,...t},n)=>g.jsx(AD,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(H6,{className:"h-4 w-4"})}));LD.displayName=AD.displayName;const jD=b.forwardRef(({className:e,...t},n)=>g.jsx(DD,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(ub,{className:"h-4 w-4"})}));jD.displayName=DD.displayName;const Gy=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>g.jsx(YJ,{children:g.jsxs(TD,{ref:s,className:ye("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",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:[g.jsx(LD,{}),g.jsx(XJ,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(jD,{})]})}));Gy.displayName=TD.displayName;const eee=b.forwardRef(({className:e,...t},n)=>g.jsx(MD,{ref:n,className:ye("px-2 py-1.5 text-sm font-semibold",e),...t}));eee.displayName=MD.displayName;const _f=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ND,{ref:r,className:ye("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:[g.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(JJ,{children:g.jsx(ao,{className:"h-4 w-4"})})}),g.jsx(QJ,{children:t})]}));_f.displayName=ND.displayName;const tee=b.forwardRef(({className:e,...t},n)=>g.jsx(OD,{ref:n,className:ye("-mx-1 my-1 h-px bg-border",e),...t}));tee.displayName=OD.displayName;const hu=[{id:"general",label:"General",icon:UP,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:CP,subtitle:"Manage the default chat provider and saved model defaults for Claude Code and Codex."},{id:"keybindings",label:"Keybindings",icon:X6,subtitle:"Edit global app shortcuts stored in the active keybindings file."},{id:"changelog",label:"Changelog",icon:R6,subtitle:"Release notes pulled from the public GitHub releases feed."}];function RE(e){return e&&hu.some(t=>t.id===e)?e:null}const nee=[{value:"light",label:"Light",icon:QP},{value:"dark",label:"Dark",icon:TP},{value:"system",label:"System",icon:hb}],ree=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],iee="https://api.github.com/repos/jakemor/kanna/releases",see=300*1e3;let ga=null;const TE=Object.keys(BA);function oee(e){return`Edit global app shortcuts stored in ${e}.`}function lee(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"}}async function aee(e=fetch){const t=await e(iee,{headers:{Accept:"application/vnd.github+json"}});if(!t.ok)throw new Error(`GitHub releases request failed with status ${t.status}`);return(await t.json()).filter(r=>!r.draft)}function cee(){return ga?Date.now()>=ga.expiresAt?(ga=null,null):ga.releases:null}function uee(e){ga={releases:e,expiresAt:Date.now()+see}}async function ME(e){const t=e!=null&&e.force?null:cee();if(t)return t;const n=await aee(e==null?void 0:e.fetchImpl);return uee(n),n}function dee(e){if(!e)return"Unpublished";const t=new Date(e);return Number.isNaN(t.getTime())?"Unknown date":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)}function hee({status:e,releases:t,error:n,onRetry:r}){return g.jsxs("div",{className:"space-y-4",children:[e==="loading"||e==="idle"?g.jsx("div",{className:"flex min-h-[180px] items-center justify-center rounded-2xl border border-border bg-card/40 px-6 py-8 text-sm text-muted-foreground",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading release notes…"})]})}):null,e==="error"?g.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-6 py-5",children:g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Could not load changelog"}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:n??"Unable to load changelog."})]}),g.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted",children:"Retry"})]})}):null,e==="success"&&t.length===0?g.jsxs("div",{className:"rounded-2xl border border-border bg-card/30 px-6 py-8",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"No releases yet"}),g.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"GitHub did not return any published releases for this repository."})]}):null,e==="success"&&t.length>0?t.map(s=>{var l,a;return g.jsxs("article",{className:"rounded-xl border border-border bg-card/30 pl-6 pr-4 py-4",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:((l=s.name)==null?void 0:l.trim())||s.tag_name}),g.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:dee(s.published_at)}),s.prerelease?g.jsx("span",{className:"rounded-full border border-border px-2.5 py-1 uppercase tracking-wide",children:"Prerelease"}):null]})]}),g.jsxs("div",{className:"flex flex-row items-center justify-end min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:g.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 font-mono text-foreground/80",children:s.tag_name})}),g.jsx("a",{href:s.html_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View release on GitHub",className:ye(sb({variant:"ghost",size:"icon-sm"}),"h-8 w-8 shrink-0 rounded-md"),children:g.jsx(fee,{className:"h-4 w-4"})})]})]}),(a=s.body)!=null&&a.trim()?g.jsx("div",{className:"prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert",children:g.jsx(ld,{remarkPlugins:[ad],components:v0,children:s.body})}):g.jsx("div",{className:"mt-5 text-sm text-muted-foreground",children:"No release notes were provided."})]},s.id)}):null]})}function fee({className:e}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:g.jsx("path",{d:"M12 .5C5.649.5.5 5.649.5 12A11.5 11.5 0 0 0 8.36 22.04c.575.106.785-.25.785-.556 0-.274-.01-1-.015-1.962-3.181.691-3.853-1.532-3.853-1.532-.52-1.322-1.27-1.674-1.27-1.674-1.038-.71.08-.695.08-.695 1.148.08 1.752 1.178 1.752 1.178 1.02 1.748 2.676 1.243 3.328.95.103-.738.399-1.243.725-1.53-2.54-.289-5.211-1.27-5.211-5.65 0-1.248.446-2.27 1.177-3.07-.118-.288-.51-1.45.112-3.024 0 0 .96-.307 3.145 1.173A10.91 10.91 0 0 1 12 6.03c.973.004 1.954.132 2.87.387 2.182-1.48 3.14-1.173 3.14-1.173.625 1.573.233 2.736.115 3.024.734.8 1.175 1.822 1.175 3.07 0 4.39-2.676 5.358-5.224 5.642.41.353.776 1.05.776 2.117 0 1.528-.014 2.761-.014 3.136 0 .309.207.668.79.555A11.502 11.502 0 0 0 23.5 12C23.5 5.649 18.351.5 12 .5Z"})})}function ss({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return g.jsx("div",{className:r?"border-t border-border":void 0,children:g.jsxs("div",{className:ye("flex flex-col gap-4 py-5 md:flex-row md:justify-between md:gap-8",s?"md:items-start":"md:items-center"),children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),g.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),g.jsx("div",{className:"flex items-center justify-start md:shrink-0 md:justify-end",children:n})]})})}function pee(){var cr,Gr;const e=Oa(),{sectionId:t}=XE(),n=Qy(),{theme:r,setTheme:s}=MA(),[l,a]=b.useState("idle"),[u,h]=b.useState([]),[d,p]=b.useState(null),m=RE(t)??"general",_=n.connectionStatus==="connecting"||!n.localProjectsReady,y=((cr=n.localProjects)==null?void 0:cr.machine.displayName)??"Unavailable",S=((Gr=n.localProjects)==null?void 0:Gr.projects.length)??0,w=Nb.split("/")[1]??"unknown",C=Hr(le=>le.scrollbackLines),k=Hr(le=>le.minColumnWidth),T=Hr(le=>le.editorPreset),R=Hr(le=>le.editorCommandTemplate),M=Hr(le=>le.setScrollbackLines),O=Hr(le=>le.setMinColumnWidth),D=Hr(le=>le.setEditorPreset),j=Hr(le=>le.setEditorCommandTemplate),F=n.keybindings,G=ls(le=>le.defaultProvider),P=ls(le=>le.providerDefaults),W=ls(le=>le.setDefaultProvider),I=ls(le=>le.setProviderDefaultModel),$=ls(le=>le.setProviderDefaultModelOptions),U=ls(le=>le.setProviderDefaultPlanMode),H=b.useMemo(()=>IA(F),[F]),B=H.filePathDisplay||l8(),[q,V]=b.useState(String(C)),[Z,N]=b.useState(String(k)),[z,Y]=b.useState(R),[A,oe]=b.useState({}),[fe,se]=b.useState(null),J=n.updateSnapshot,ge=lee(J),ie=(J==null?void 0:J.status)==="checking"?"Checking for updates…":(J==null?void 0:J.status)==="updating"?"Installing update…":(J==null?void 0:J.status)==="restart_pending"?"Restarting Kanna…":(J==null?void 0:J.status)==="available"?`Update available${J.latestVersion?`: ${J.latestVersion}`:""}`:(J==null?void 0:J.status)==="up_to_date"?"Up to date":(J==null?void 0:J.status)==="error"?"Update check failed":"Not checked yet";b.useEffect(()=>{V(String(C))},[C]),b.useEffect(()=>{N(String(k))},[k]),b.useEffect(()=>{Y(R)},[R]),b.useEffect(()=>{oe(Object.fromEntries(TE.map(le=>[le,Hv(H.bindings[le])])))},[H]),b.useEffect(()=>{t&&(RE(t)||e("/settings/general",{replace:!0}))},[e,t]),b.useEffect(()=>{if(m!=="changelog"||_)return;let le=!1;return a("loading"),p(null),ME().then(Rt=>{le||(h(Rt),a("success"))}).catch(Rt=>{le||(p(Rt instanceof Error?Rt.message:"Unable to load changelog."),a("error"))}),()=>{le=!0}},[_,m]);function ce(){const le=Number(q);if(!Number.isFinite(le)){V(String(C));return}M(le)}function we(){const le=Number(Z);if(!Number.isFinite(le)){N(String(k));return}O(le)}function Se(le,Rt){le.key==="Enter"&&(Rt(),le.currentTarget.blur())}function ke(le,Rt){le.key==="Enter"&&(Rt(),le.currentTarget.blur())}function Be(){j(z)}async function Ce(){try{se(null),await n.socket.command({type:"settings.writeKeybindings",bindings:NE(A)})}catch(le){se(le instanceof Error?le.message:"Unable to save keybindings.")}}async function Oe(le){const Rt={...A,[le]:Hv(no[le])};oe(Rt);try{se(null),await n.socket.command({type:"settings.writeKeybindings",bindings:NE(Rt)})}catch(ue){se(ue instanceof Error?ue.message:"Unable to save keybindings.")}}function bt(){ga=null,a("loading"),p(null),ME({force:!0}).then(le=>{h(le),a("success")}).catch(le=>{p(le instanceof Error?le.message:"Unable to load changelog."),a("error")})}const hn=z.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),xt=hu.find(le=>le.id===m)??hu[0],zt=m==="keybindings"?oee(B):xt.subtitle,In=!_;return g.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[g.jsxs("div",{className:"flex min-w-0 flex-1",children:[g.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${In?"pb-[89px]":""}`,children:g.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[g.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),hu.map(le=>g.jsx("button",{type:"button",onClick:()=>e(`/settings/${le.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${le.id===m?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx(le.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{children:le.label})]})},le.label))]})}),g.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[g.jsx("div",{className:"border-b border-border py-2 md:hidden",children:g.jsx("div",{className:"overflow-x-auto pr-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:g.jsxs("div",{className:"flex min-w-max items-center gap-2",children:[g.jsx("div",{className:" sticky left-0 bg-gradient-to-r from-background via-background/80 to-transparent px-2 py-1",children:g.jsx("button",{type:"button",onClick:n.openSidebar,className:"flex shrink-0 items-center p-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground","aria-label":"Open sidebar",title:"Open sidebar",children:g.jsx(db,{className:"h-4 w-4 shrink-0"})})}),hu.map(le=>g.jsxs("button",{type:"button",onClick:()=>e(`/settings/${le.id}`),className:ye("flex shrink-0 items-center gap-2 rounded-full border px-3 py-2 text-sm transition-colors",le.id===m?"border-transparent bg-muted font-medium text-foreground":"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[g.jsx(le.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{className:"whitespace-nowrap",children:le.label})]},le.label))]})})}),g.jsxs("div",{className:"w-full px-4 pb-32 pt-8 md:px-6 md:pt-16",children:[_?g.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:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading machine settings…"})]})}):g.jsxs("div",{className:"mx-auto max-w-4xl",children:[g.jsxs("div",{className:"pb-6",children:[g.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:xt.label}),m==="keybindings"?g.jsxs(SE,{onClick:()=>{n.handleOpenExternalPath("open_editor",B)},icon:g.jsx(QR,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):null,m==="general"?g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(SE,{variant:ge.variant,onClick:()=>{if(ge.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:ge.disabled,icon:ge.kind==="check"?g.jsx(jP,{className:ye("size-3.5",ge.spinning&&"animate-spin")}):ge.kind==="update"?g.jsx(q6,{className:ye("size-3.5")}):void 0,children:ge.label})}):null]}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:zt})]}),m==="general"?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"border-b border-border",children:[g.jsx(ss,{title:"Application Update",description:g.jsxs(g.Fragment,{children:[g.jsxs("span",{children:[ie,"."]}),J!=null&&J.lastCheckedAt?g.jsxs("span",{children:[" Last checked ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(J.lastCheckedAt),"."]}):null,J!=null&&J.error?g.jsxs("span",{children:[" ",J.error]}):null]}),bordered:!1,children:g.jsxs("div",{className:"text-right text-sm text-foreground",children:[g.jsxs("div",{children:["Current: ",(J==null?void 0:J.currentVersion)??w]}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(J==null?void 0:J.latestVersion)??"Unknown"]})]})}),g.jsx(ss,{title:"Theme",description:"Choose between light, dark, or system appearance",children:g.jsx(Z5,{value:r,onValueChange:s,options:nee,size:"sm"})}),g.jsx(ss,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:g.jsxs(CE,{value:T,onValueChange:le=>D(le),children:[g.jsx(Ky,{className:"min-w-[180px]",children:g.jsx(EE,{})}),g.jsx(Gy,{children:g.jsx(kE,{children:ree.map(le=>g.jsx(_f,{value:le.value,children:le.label},le.value))})})]})}),T==="custom"?g.jsx("div",{className:"border-t border-border",children:g.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),g.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),g.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[g.jsx(io,{type:"text",value:z,onChange:le=>Y(le.target.value),onBlur:Be,onKeyDown:le=>ke(le,Be),className:"font-mono"}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",g.jsx("span",{className:"font-mono",children:hn})]})]})]})}):null,g.jsx(ss,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:g.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[g.jsx(io,{type:"number",min:ky,max:Ey,step:100,value:q,onChange:le=>V(le.target.value),onBlur:ce,onKeyDown:le=>Se(le,ce),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),g.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[ky,"-",Ey," lines",C===Vf?" (default)":""]})]})}),g.jsx(ss,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:g.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[g.jsx(io,{type:"number",min:Ry,max:Ty,step:10,value:Z,onChange:le=>N(le.target.value),onBlur:we,onKeyDown:le=>Se(le,we),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),g.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Ry,"-",Ty," px",k===qf?" (default)":""]})]})})]})}):m==="providers"?g.jsxs("div",{className:"border-b border-border",children:[g.jsx(ss,{title:"Default Provider",description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:g.jsxs(CE,{value:G,onValueChange:le=>W(le),children:[g.jsx(Ky,{className:"min-w-[180px]",children:g.jsx(EE,{})}),g.jsx(Gy,{children:g.jsxs(kE,{children:[g.jsx(_f,{value:"last_used",children:"Last Used"}),_u.map(le=>g.jsx(_f,{value:le.id,children:le.label},le.id))]})})]})}),g.jsx(ss,{title:"Claude Code Defaults",description:"Saved defaults when using Claude Code.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(P_,{availableProviders:_u,selectedProvider:"claude",showProviderPicker:!1,providerLocked:!0,model:P.claude.model,modelOptions:P.claude.modelOptions,onModelChange:(le,Rt)=>{I("claude",Rt)},onClaudeReasoningEffortChange:le=>{$("claude",{reasoningEffort:le})},onClaudeContextWindowChange:le=>{$("claude",{contextWindow:le})},onCodexReasoningEffortChange:()=>{},onCodexFastModeChange:()=>{},planMode:P.claude.planMode,onPlanModeChange:le=>U("claude",le),includePlanMode:!0,className:"justify-start flex-wrap"})})}),g.jsx(ss,{title:"Codex Defaults",description:"Saved defaults when using Codex.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(P_,{availableProviders:_u,selectedProvider:"codex",showProviderPicker:!1,providerLocked:!0,model:P.codex.model,modelOptions:P.codex.modelOptions,onModelChange:(le,Rt)=>{I("codex",Rt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:le=>{$("codex",{reasoningEffort:le})},onCodexFastModeChange:le=>{$("codex",{fastMode:le})},planMode:P.codex.planMode,onPlanModeChange:le=>U("codex",le),includePlanMode:!0,className:"justify-start flex-wrap"})})})]}):m==="keybindings"?g.jsxs("div",{className:"border-b border-border",children:[fe?g.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:fe}):null,H.warning?g.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:H.warning}):null,TE.map((le,Rt)=>{const ue=Hv(no[le]),ve=A[le]??"",Le=ve!==ue;return g.jsx(ss,{title:BA[le],description:g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"Comma-separated shortcuts."}),Le?g.jsxs(g.Fragment,{children:[g.jsx("span",{children:" "}),g.jsxs("button",{type:"button",onClick:()=>{Oe(le)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",ue]})]}):null]}),bordered:Rt!==0,children:g.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:g.jsx(io,{type:"text",value:ve,onChange:Ie=>{const Xe=Ie.target.value;oe(Ct=>({...Ct,[le]:Xe}))},onBlur:()=>{Ce()},onKeyDown:Ie=>ke(Ie,()=>{Ce()}),className:"font-mono"})})},le)})]}):g.jsx(hee,{status:l,releases:u,error:d,onRetry:bt})]}),n.commandError?g.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:[g.jsx(pP,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),g.jsx("span",{children:n.commandError})]}):null]})]})]}),In?g.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:g.jsx("div",{className:"px-6 py-[14.25px]",children:g.jsxs("div",{className:"grid gap-3 text-xs text-muted-foreground grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Machine"}),g.jsx("div",{className:"text-foreground/80",children:y})]}),g.jsxs("div",{className:"hidden md:block",children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Connection"}),g.jsx("div",{className:"text-foreground/80",children:n.connectionStatus})]}),g.jsxs("div",{className:"hidden md:block",children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Projects Indexed"}),g.jsx("div",{className:"text-foreground/80",children:S})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"App Version"}),g.jsx("div",{className:"text-foreground/80",children:w})]})]})})}):null]})}function NE(e){return{toggleEmbeddedTerminal:Xc(e.toggleEmbeddedTerminal??""),toggleRightSidebar:Xc(e.toggleRightSidebar??""),openInFinder:Xc(e.openInFinder??""),openInEditor:Xc(e.openInEditor??""),addSplitTerminal:Xc(e.addSplitTerminal??"")}}function Zh(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function mee(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function gee(e,t){const n=mee(t);switch(e.toolKind){case"ask_user_question":{const s=Zh(n),l=Zh(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(l).map(([a,u])=>Array.isArray(u)?[a,u.map(h=>String(h))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[a,u.answers.map(h=>String(h))]:u==null||u===""?[a,[]]:[a,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Zh(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=Zh(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function zD(e){return new Date(e).toISOString()}function ti(e){return{id:e._id,messageId:e.messageId,timestamp:zD(e.createdAt),hidden:e.hidden}}function vee(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:zD(e.createdAt)}}function _ee(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function yee(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...ti(r),kind:"user_prompt",content:r.content});break;case"system_init":n.push({...ti(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({...ti(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...ti(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=vee(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 l=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?_ee(r)??r.content:r.content;s.hydrated.result=gee(s.normalized,l),s.hydrated.rawResult=l,s.hydrated.isError=r.isError}break}case"result":n.push({...ti(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...ti(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...ti(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...ti(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...ti(r),kind:"context_cleared"});break;case"interrupted":n.push({...ti(r),kind:"interrupted"});break;default:n.push({...ti(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const bee=["AskUserQuestion","ExitPlanMode","TodoWrite"],xee=new Set(["TodoWrite"]);function See(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 wee(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 Cee(e){const t={};for(const n of bee)t[n]=xee.has(n)?wee(e,n):See(e,n);return t}function kee(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function Eee(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const Ree=25e3,Tee=15e3,Mee=4e3;class Nee{constructor(t){on(this,"url");on(this,"ws",null);on(this,"started",!1);on(this,"reconnectTimer",null);on(this,"reconnectDelayMs",750);on(this,"subscriptions",new Map);on(this,"pending",new Map);on(this,"outboundQueue",[]);on(this,"statusListeners",new Set);on(this,"heartbeatTimer",null);on(this,"pingTimeoutTimer",null);on(this,"pingPromise",null);on(this,"lastOpenAt",0);on(this,"lastMessageAt",0);on(this,"reconnectImmediatelyOnClose",!1);on(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});on(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});on(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=lv();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=lv(),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=lv(),r={v:1,type:"command",id:n,command:t};return new Promise((s,l)=>{this.pending.set(n,{resolve:s,reject:l}),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(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(n8,n.message);return}const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.reject(new Error(n.message))}}),this.ws.addEventListener("close",()=>{if(!this.started)return;const t=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const n of this.pending.values())n.reject(new Error("Disconnected"));if(this.pending.clear(),t){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>=Ree}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()},Mee),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()},Tee))}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);return}this.outboundQueue.push(t)}sendNow(t){var n;(n=this.ws)==null||n.send(JSON.stringify(t))}}function Aee(e,t){var r;const n=e.find(s=>s.chats.some(l=>l.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function Dee(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Oee(){const e=b.useRef(null);return e.current||(e.current=new Nee(Dee())),b.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function fu(e,t){if(t===void 0){console.info(`[useKannaState] ${e}`);return}console.info(`[useKannaState] ${e}`,t)}function Lee(e){return e<24}function jee(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"navigate_changelog":"none"}const zee=320,B0="kanna:ui-update-restart";function Pee(){return window.sessionStorage.getItem(B0)}function AE(e){window.sessionStorage.setItem(B0,e)}function d_(){window.sessionStorage.removeItem(B0)}function Bee(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 Iee(e,t){return!e||!t?null:e.runtime.chatId!==t?(fu("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function Hee(e){var Li,At,Dt;const t=Oa(),n=Oee(),r=fB(),[s,l]=b.useState({projectGroups:[]}),[a,u]=b.useState(null),[h,d]=b.useState(null),[p,m]=b.useState(null),[_,y]=b.useState(null),[S,w]=b.useState("connecting"),[C,k]=b.useState(!1),[T,R]=b.useState(!1),[M,O]=b.useState(!1),[D,j]=b.useState(null),[F,G]=b.useState(!1),[P,W]=b.useState(!1),[I,$]=b.useState(148),[U,H]=b.useState(!0),[B,q]=b.useState(null),[V,Z]=b.useState(null),[N,z]=b.useState(null),Y=KV(Hr(re=>re.editorPreset)),A=b.useRef(null),oe=b.useRef(null),fe=b.useRef(!1),se=b.useRef(null);b.useEffect(()=>n.onStatus(w),[n]),b.useEffect(()=>n.subscribe({type:"sidebar"},re=>{l(re),k(!0),q(null)}),[n]),b.useEffect(()=>n.subscribe({type:"local-projects"},re=>{u(re),R(!0),q(null)}),[n]),b.useEffect(()=>n.subscribe({type:"update"},re=>{d(re),q(null)}),[n]),b.useEffect(()=>{S==="connected"&&n.command({type:"update.check",force:!0}).catch(re=>{q(re instanceof Error?re.message:String(re))})},[S,n]),b.useEffect(()=>{const re=Pee(),_e=jee(re,S);if(_e==="awaiting_reconnect"){AE("awaiting_reconnect");return}_e==="navigate_changelog"&&(d_(),t("/settings/changelog",{replace:!0}))},[S,t]),b.useEffect(()=>{function re(){h!=null&&h.lastCheckedAt&&(Date.now()-h.lastCheckedAt<=3600*1e3||n.command({type:"update.check"}).catch(_e=>{q(_e instanceof Error?_e.message:String(_e))}))}return window.addEventListener("focus",re),()=>{window.removeEventListener("focus",re)}},[n,h==null?void 0:h.lastCheckedAt]),b.useEffect(()=>n.subscribe({type:"keybindings"},re=>{y(re),q(null)}),[n]),b.useEffect(()=>{if(!e){fu("clearing chat snapshot for non-chat route"),m(null),O(!0);return}return fu("subscribing to chat",{activeChatId:e}),m(null),O(!1),n.subscribe({type:"chat",chatId:e},re=>{fu("chat snapshot received",{activeChatId:e,snapshotChatId:(re==null?void 0:re.runtime.chatId)??null,snapshotProvider:(re==null?void 0:re.runtime.provider)??null,snapshotStatus:(re==null?void 0:re.runtime.status)??null}),m(re),O(!0),q(null)})},[e,n]),b.useEffect(()=>{if(D)return;const re=s.projectGroups[0];re&&j(re.groupKey)},[D,s.projectGroups]),b.useEffect(()=>{if(!e||!C||!M)return;if(s.projectGroups.some(_e=>_e.chats.some(Ue=>Ue.chatId===e))){N===e&&z(null);return}N!==e&&t("/")},[e,M,t,N,s.projectGroups,C]),b.useEffect(()=>{p&&(j(p.runtime.projectId),N===p.runtime.chatId&&z(null))},[p,N]),b.useEffect(()=>{fe.current=!1,se.current!==null&&(window.cancelAnimationFrame(se.current),se.current=null),H(!0)},[e]),b.useEffect(()=>()=>{se.current!==null&&window.cancelAnimationFrame(se.current)},[]),b.useLayoutEffect(()=>{const re=oe.current;if(!re)return;const _e=new ResizeObserver(()=>{$(re.getBoundingClientRect().height)});return _e.observe(re),$(re.getBoundingClientRect().height),()=>_e.disconnect()},[]);const J=b.useMemo(()=>Iee(p,e),[e,p]);b.useEffect(()=>{fu("active snapshot resolved",{routeChatId:e,rawSnapshotChatId:(p==null?void 0:p.runtime.chatId)??null,rawSnapshotProvider:(p==null?void 0:p.runtime.provider)??null,activeSnapshotChatId:(J==null?void 0:J.runtime.chatId)??null,activeSnapshotProvider:(J==null?void 0:J.runtime.provider)??null,pendingChatId:N})},[e,J,p,N]);const ge=b.useMemo(()=>yee((J==null?void 0:J.messages)??[]),[J==null?void 0:J.messages]),ie=b.useMemo(()=>Cee(ge),[ge]),ce=(J==null?void 0:J.runtime)??null,we=(J==null?void 0:J.availableProviders)??_u,Se=Eee(ce==null?void 0:ce.status),ke=kee(ce==null?void 0:ce.status),Be=zee,Ce=!U&&ge.length>0,Oe=((Li=a==null?void 0:a.projects[0])==null?void 0:Li.localPath)??null,bt=(ce==null?void 0:ce.localPath)??Oe??((At=s.projectGroups[0])==null?void 0:At.localPath),hn=!!(D??(ce==null?void 0:ce.projectId)??((Dt=s.projectGroups[0])==null?void 0:Dt.groupKey)??Oe);b.useLayoutEffect(()=>{if(fe.current)return;const re=A.current;re&&(e&&!ce||(re.scrollTo({top:re.scrollHeight,behavior:"auto"}),se.current!==null&&window.cancelAnimationFrame(se.current),se.current=window.requestAnimationFrame(()=>{const _e=A.current;_e&&(_e.scrollTo({top:_e.scrollHeight,behavior:"auto"}),se.current=null)}),fe.current=!0))},[e,I,ge.length,ce]),b.useEffect(()=>{if(!fe.current||!U)return;const re=window.requestAnimationFrame(()=>{const _e=A.current;!_e||!U||_e.scrollTo({top:_e.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(re)},[e,I,U,ge.length,ce==null?void 0:ce.status]);function xt(){const re=A.current;if(!re)return;const _e=re.scrollHeight-re.scrollTop-re.clientHeight;H(Lee(_e))}function zt(re){const _e=A.current;H(!0),_e&&_e.scrollTo({top:_e.scrollHeight,behavior:re})}function In(){zt("smooth")}async function cr(re){ls.getState().initializeComposerForNewChat();const _e=await n.command({type:"chat.create",projectId:re});j(re),z(_e.chatId),t(`/chat/${_e.chatId}`),G(!1),q(null)}async function Gr(re){return re.kind==="project_id"?{projectId:re.projectId}:re.kind==="local_path"?{projectId:(await n.command({type:"project.open",localPath:re.localPath})).projectId,localPath:re.localPath}:{projectId:(await n.command(re.project.mode==="new"?{type:"project.create",localPath:re.project.localPath,title:re.project.title}:{type:"project.open",localPath:re.project.localPath})).projectId,localPath:re.project.localPath}}async function le(re){try{const _e=re.kind==="project_id"?null:re.kind==="local_path"?re.localPath:re.project.localPath;_e&&Z(_e);const{projectId:Ue}=await Gr(re);await cr(Ue)}catch(_e){q(_e instanceof Error?_e.message:String(_e))}finally{Z(null)}}async function Rt(re){await le({kind:"project_id",projectId:re})}async function ue(re){await le({kind:"local_path",localPath:re})}async function ve(re){await le({kind:"project_request",project:re})}async function Le(re){try{await n.command({type:"update.check",force:re==null?void 0:re.force}),q(null)}catch(_e){q(_e instanceof Error?_e.message:String(_e))}}async function Ie(){try{const re=await n.command({type:"update.install"});if(!re.ok){d_(),q(null),await r.alert({title:re.userTitle??"Update failed",description:re.userMessage??"Kanna could not install the update. Try again later.",closeLabel:"OK"});return}if(re.ok&&re.action==="reload"){window.location.reload();return}re.ok&&re.action==="restart"&&AE("awaiting_disconnect"),q(null)}catch(re){d_(),q(re instanceof Error?re.message:String(re))}}async function Xe(re,_e){var Ue;try{let Ye=D??((Ue=s.projectGroups[0])==null?void 0:Ue.groupKey)??null;if(!e&&!Ye&&Oe&&(Ye=(await n.command({type:"project.open",localPath:Oe})).projectId,j(Ye)),!e&&!Ye)throw new Error("Open a project first");zt("auto");const lt=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Ye??void 0,provider:_e==null?void 0:_e.provider,content:re,model:_e==null?void 0:_e.model,modelOptions:_e==null?void 0:_e.modelOptions,planMode:_e==null?void 0:_e.planMode});!e&<.chatId&&(z(lt.chatId),t(`/chat/${lt.chatId}`)),q(null)}catch(Ye){throw q(Ye instanceof Error?Ye.message:String(Ye)),Ye}}async function Ct(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(re){q(re instanceof Error?re.message:String(re))}}async function Yn(re){if(await r.confirm({title:"Delete Chat",description:`Delete "${re.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:re.chatId}),re.chatId===e){const Ue=Aee(s.projectGroups,re.chatId);t(Ue?`/chat/${Ue}`:"/")}}catch(Ue){q(Ue instanceof Error?Ue.message:String(Ue))}}async function nn(re){const _e=s.projectGroups.find(lt=>lt.groupKey===re);if(!_e)return;const Ue=_e.localPath.split("/").filter(Boolean).pop()??_e.localPath;if(await r.confirm({title:"Remove",description:`Remove "${Ue}" from the sidebar? Existing chats will be removed from ${$n}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:re}),Js.getState().clearProject(re),gf.getState().clearProject(re),(ce==null?void 0:ce.projectId)===re&&t("/"),q(null)}catch(lt){q(lt instanceof Error?lt.message:String(lt))}}async function Pt(re){var Ue,Ye;const _e=(ce==null?void 0:ce.localPath)??((Ue=a==null?void 0:a.projects[0])==null?void 0:Ue.localPath)??((Ye=s.projectGroups[0])==null?void 0:Ye.localPath);if(_e)try{await Xn({action:re,localPath:_e})}catch(lt){q(lt instanceof Error?lt.message:String(lt))}}async function Gt(re){try{await Xn({action:"open_editor",localPath:re.path,line:re.line,column:re.column})}catch(_e){q(_e instanceof Error?_e.message:String(_e))}}async function ot(re,_e){try{await Xn({action:re,localPath:_e})}catch(Ue){q(Ue instanceof Error?Ue.message:String(Ue))}}async function Xn(re){const _e=Hr.getState();q(null),await n.command({type:"system.openExternal",...re,editor:re.action==="open_editor"?{preset:_e.editorPreset,commandTemplate:_e.editorCommandTemplate}:void 0})}function Dn(){var _e;const re=Bee({selectedProjectId:D,sidebarProjectId:(_e=s.projectGroups[0])==null?void 0:_e.groupKey,fallbackLocalProjectPath:Oe});if(re){le(re);return}t("/")}async function Ya(re,_e,Ue){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{questions:_e,answers:Ue}})}catch(Ye){q(Ye instanceof Error?Ye.message:String(Ye))}}async function bs(re,_e,Ue,Ye){if(e){_e&&ls.getState().setComposerPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{confirmed:_e,...Ue?{clearContext:!0}:{},...Ye?{message:Ye}:{}}})}catch(lt){q(lt instanceof Error?lt.message:String(lt))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:a,updateSnapshot:h,chatSnapshot:p,keybindings:_,connectionStatus:S,sidebarReady:C,localProjectsReady:T,commandError:B,startingLocalPath:V,sidebarOpen:F,sidebarCollapsed:P,scrollRef:A,inputRef:oe,messages:ge,latestToolIds:ie,runtime:ce,availableProviders:we,isProcessing:Se,canCancel:ke,transcriptPaddingBottom:Be,showScrollButton:Ce,navbarLocalPath:bt,editorLabel:Y,hasSelectedProject:hn,openSidebar:()=>G(!0),closeSidebar:()=>G(!1),collapseSidebar:()=>W(!0),expandSidebar:()=>W(!1),updateScrollState:xt,scrollToBottom:In,handleCreateChat:Rt,handleOpenLocalProject:ue,handleCreateProject:ve,handleCheckForUpdates:Le,handleInstallUpdate:Ie,handleSend:Xe,handleCancel:Ct,handleDeleteChat:Yn,handleRemoveProject:nn,handleOpenExternal:Pt,handleOpenExternalPath:ot,handleOpenLocalLink:Gt,handleCompose:Dn,handleAskUserQuestion:Ya,handleExitPlanMode:bs}}const DE="kanna:last-seen-version";function Fee(e,t,n){return e==="/"&&!!t&&n!==t}function Uee(){const e=ui(),t=Oa(),n=XE(),r=Hee(n.chatId??null),s=e.pathname==="/",l=Nb.split("/")[1]??"unknown";return b.useEffect(()=>{const a=window.localStorage.getItem(DE),u=Fee(e.pathname,l,a);window.localStorage.setItem(DE,l),u&&t("/settings/changelog",{replace:!0})},[l,e.pathname,t]),g.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[g.jsx(IH,{data:r.sidebarData,activeChatId:r.activeChatId,connectionStatus:r.connectionStatus,ready:r.sidebarReady,open:r.sidebarOpen,collapsed:r.sidebarCollapsed,showMobileOpenButton:s,onOpen:r.openSidebar,onClose:r.closeSidebar,onCollapse:r.collapseSidebar,onExpand:r.expandSidebar,onCreateChat:a=>{r.handleCreateChat(a)},onDeleteChat:a=>{r.handleDeleteChat(a)},onRemoveProject:a=>{r.handleRemoveProject(a)},updateSnapshot:r.updateSnapshot,onInstallUpdate:()=>{r.handleInstallUpdate()}}),g.jsx(iL,{context:r})]})}function $ee(){return g.jsx(YI,{children:g.jsx(hB,{children:g.jsx(oL,{children:g.jsxs(ua,{element:g.jsx(Uee,{}),children:[g.jsx(ua,{path:"/",element:g.jsx(CJ,{})}),g.jsx(ua,{path:"/settings",element:g.jsx(rL,{to:"/settings/general",replace:!0})}),g.jsx(ua,{path:"/settings/:sectionId",element:g.jsx(pee,{})}),g.jsx(ua,{path:"/chat/:chatId",element:g.jsx(vJ,{})})]})})})})}const PD=document.getElementById("root");if(!PD)throw new Error("Missing #root");o4.createRoot(PD).render(g.jsx(b.StrictMode,{children:g.jsx(NL,{children:g.jsx(CV,{children:g.jsx($ee,{})})})}));
|