ai-agent-session-center 2.3.2 → 2.3.3

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.
Files changed (24) hide show
  1. package/README.md +30 -16
  2. package/dist/client/assets/{AnalyticsView-YRASbt1m.js → AnalyticsView-DVDqblSH.js} +1 -1
  3. package/dist/client/assets/{Charts.module-CrwDIRs9.js → Charts.module-CQf7HQCb.js} +1 -1
  4. package/dist/client/assets/{CyberdromeScene-CQ0JUjR0.js → CyberdromeScene-w4bk6IXJ.js} +1 -1
  5. package/dist/client/assets/{HistoryView-Fz2_E2lb.js → HistoryView--XwKlCyd.js} +1 -1
  6. package/dist/client/assets/{ProjectBrowserView-DYnCNpma.js → ProjectBrowserView-CTN5CmBa.js} +1 -1
  7. package/dist/client/assets/{QueueView-Ben9YLiL.js → QueueView-Bj-e0m_U.js} +1 -1
  8. package/dist/client/assets/{TimelineView-CtshpaEr.js → TimelineView-CoTsTAGd.js} +1 -1
  9. package/dist/client/assets/index-Dgi6T0Nt.js +128 -0
  10. package/dist/client/assets/index-DqtLpLIs.css +1 -0
  11. package/dist/client/assets/{useQuery-C9Q607lk.js → useQuery-5GNo2Ewt.js} +1 -1
  12. package/dist/client/assets/{with-selector-DNJRp3mp.js → with-selector-DTnjuyBc.js} +1 -1
  13. package/dist/client/index.html +2 -2
  14. package/dist/client/screenshot-dashboard.png +0 -0
  15. package/dist/client/screenshot-project-tab.png +0 -0
  16. package/package.json +1 -1
  17. package/static/screenshot-dashboard.png +0 -0
  18. package/static/screenshot-mobile-history.png +0 -0
  19. package/static/screenshot-mobile-home.png +0 -0
  20. package/static/screenshot-mobile-project.png +0 -0
  21. package/static/screenshot-mobile-terminal.png +0 -0
  22. package/static/screenshot-project-tab.png +0 -0
  23. package/dist/client/assets/index-B1iUo-kL.js +0 -122
  24. package/dist/client/assets/index-C5tAimN4.css +0 -1
@@ -0,0 +1,128 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CyberdromeScene-w4bk6IXJ.js","assets/with-selector-DTnjuyBc.js","assets/HistoryView--XwKlCyd.js","assets/useQuery-5GNo2Ewt.js","assets/HistoryView-Cu23DcIM.css","assets/TimelineView-CoTsTAGd.js","assets/Charts.module-CQf7HQCb.js","assets/Charts-BN9-_lNy.css","assets/AnalyticsView-DVDqblSH.js","assets/QueueView-Bj-e0m_U.js","assets/QueueView-QjjiV10n.css"])))=>i.map(i=>d[i]);
2
+ function FT(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();var jT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function id(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var my={exports:{}},ch={};var Jx;function UT(){if(Jx)return ch;Jx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,a){var l=null;if(a!==void 0&&(l=""+a),r.key!==void 0&&(l=""+r.key),"key"in r){a={};for(var o in r)o!=="key"&&(a[o]=r[o])}else a=r;return r=a.ref,{$$typeof:n,type:i,key:l,ref:r!==void 0?r:null,props:a}}return ch.Fragment=e,ch.jsx=t,ch.jsxs=t,ch}var Qx;function HT(){return Qx||(Qx=1,my.exports=UT()),my.exports}var A=HT(),gy={exports:{}},$t={};var eS;function qT(){if(eS)return $t;eS=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),m=Symbol.iterator;function g(F){return F===null||typeof F!="object"?null:(F=m&&F[m]||F["@@iterator"],typeof F=="function"?F:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function x(F,$,W){this.props=F,this.context=$,this.refs=v,this.updater=W||_}x.prototype.isReactComponent={},x.prototype.setState=function(F,$){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,$,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=x.prototype;function b(F,$,W){this.props=F,this.context=$,this.refs=v,this.updater=W||_}var C=b.prototype=new S;C.constructor=b,w(C,x.prototype),C.isPureReactComponent=!0;var O=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function B(F,$,W){var ye=W.ref;return{$$typeof:n,type:F,key:$,ref:ye!==void 0?ye:null,props:W}}function U(F,$){return B(F.type,$,F.props)}function Y(F){return typeof F=="object"&&F!==null&&F.$$typeof===n}function K(F){var $={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(W){return $[W]})}var H=/\/+/g;function J(F,$){return typeof F=="object"&&F!==null&&F.key!=null?K(""+F.key):$.toString(36)}function Q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(M,M):(F.status="pending",F.then(function($){F.status==="pending"&&(F.status="fulfilled",F.value=$)},function($){F.status==="pending"&&(F.status="rejected",F.reason=$)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function Z(F,$,W,ye,be){var Ne=typeof F;(Ne==="undefined"||Ne==="boolean")&&(F=null);var le=!1;if(F===null)le=!0;else switch(Ne){case"bigint":case"string":case"number":le=!0;break;case"object":switch(F.$$typeof){case n:case e:le=!0;break;case p:return le=F._init,Z(le(F._payload),$,W,ye,be)}}if(le)return be=be(F),le=ye===""?"."+J(F,0):ye,O(be)?(W="",le!=null&&(W=le.replace(H,"$&/")+"/"),Z(be,$,W,"",function(xe){return xe})):be!=null&&(Y(be)&&(be=U(be,W+(be.key==null||F&&F.key===be.key?"":(""+be.key).replace(H,"$&/")+"/")+le)),$.push(be)),1;le=0;var ee=ye===""?".":ye+":";if(O(F))for(var Ce=0;Ce<F.length;Ce++)ye=F[Ce],Ne=ee+J(ye,Ce),le+=Z(ye,$,W,Ne,be);else if(Ce=g(F),typeof Ce=="function")for(F=Ce.call(F),Ce=0;!(ye=F.next()).done;)ye=ye.value,Ne=ee+J(ye,Ce++),le+=Z(ye,$,W,Ne,be);else if(Ne==="object"){if(typeof F.then=="function")return Z(Q(F),$,W,ye,be);throw $=String(F),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return le}function ie(F,$,W){if(F==null)return F;var ye=[],be=0;return Z(F,ye,"","",function(Ne){return $.call(W,Ne,be++)}),ye}function ne(F){if(F._status===-1){var $=F._result;$=$(),$.then(function(W){(F._status===0||F._status===-1)&&(F._status=1,F._result=W)},function(W){(F._status===0||F._status===-1)&&(F._status=2,F._result=W)}),F._status===-1&&(F._status=0,F._result=$)}if(F._status===1)return F._result.default;throw F._result}var P=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},L={map:ie,forEach:function(F,$,W){ie(F,function(){$.apply(this,arguments)},W)},count:function(F){var $=0;return ie(F,function(){$++}),$},toArray:function(F){return ie(F,function($){return $})||[]},only:function(F){if(!Y(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return $t.Activity=f,$t.Children=L,$t.Component=x,$t.Fragment=t,$t.Profiler=r,$t.PureComponent=b,$t.StrictMode=i,$t.Suspense=u,$t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,$t.__COMPILER_RUNTIME={__proto__:null,c:function(F){return D.H.useMemoCache(F)}},$t.cache=function(F){return function(){return F.apply(null,arguments)}},$t.cacheSignal=function(){return null},$t.cloneElement=function(F,$,W){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var ye=w({},F.props),be=F.key;if($!=null)for(Ne in $.key!==void 0&&(be=""+$.key),$)!N.call($,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&$.ref===void 0||(ye[Ne]=$[Ne]);var Ne=arguments.length-2;if(Ne===1)ye.children=W;else if(1<Ne){for(var le=Array(Ne),ee=0;ee<Ne;ee++)le[ee]=arguments[ee+2];ye.children=le}return B(F.type,be,ye)},$t.createContext=function(F){return F={$$typeof:l,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:a,_context:F},F},$t.createElement=function(F,$,W){var ye,be={},Ne=null;if($!=null)for(ye in $.key!==void 0&&(Ne=""+$.key),$)N.call($,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(be[ye]=$[ye]);var le=arguments.length-2;if(le===1)be.children=W;else if(1<le){for(var ee=Array(le),Ce=0;Ce<le;Ce++)ee[Ce]=arguments[Ce+2];be.children=ee}if(F&&F.defaultProps)for(ye in le=F.defaultProps,le)be[ye]===void 0&&(be[ye]=le[ye]);return B(F,Ne,be)},$t.createRef=function(){return{current:null}},$t.forwardRef=function(F){return{$$typeof:o,render:F}},$t.isValidElement=Y,$t.lazy=function(F){return{$$typeof:p,_payload:{_status:-1,_result:F},_init:ne}},$t.memo=function(F,$){return{$$typeof:h,type:F,compare:$===void 0?null:$}},$t.startTransition=function(F){var $=D.T,W={};D.T=W;try{var ye=F(),be=D.S;be!==null&&be(W,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(M,P)}catch(Ne){P(Ne)}finally{$!==null&&W.types!==null&&($.types=W.types),D.T=$}},$t.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},$t.use=function(F){return D.H.use(F)},$t.useActionState=function(F,$,W){return D.H.useActionState(F,$,W)},$t.useCallback=function(F,$){return D.H.useCallback(F,$)},$t.useContext=function(F){return D.H.useContext(F)},$t.useDebugValue=function(){},$t.useDeferredValue=function(F,$){return D.H.useDeferredValue(F,$)},$t.useEffect=function(F,$){return D.H.useEffect(F,$)},$t.useEffectEvent=function(F){return D.H.useEffectEvent(F)},$t.useId=function(){return D.H.useId()},$t.useImperativeHandle=function(F,$,W){return D.H.useImperativeHandle(F,$,W)},$t.useInsertionEffect=function(F,$){return D.H.useInsertionEffect(F,$)},$t.useLayoutEffect=function(F,$){return D.H.useLayoutEffect(F,$)},$t.useMemo=function(F,$){return D.H.useMemo(F,$)},$t.useOptimistic=function(F,$){return D.H.useOptimistic(F,$)},$t.useReducer=function(F,$,W){return D.H.useReducer(F,$,W)},$t.useRef=function(F){return D.H.useRef(F)},$t.useState=function(F){return D.H.useState(F)},$t.useSyncExternalStore=function(F,$,W){return D.H.useSyncExternalStore(F,$,W)},$t.useTransition=function(){return D.H.useTransition()},$t.version="19.2.4",$t}var tS;function D0(){return tS||(tS=1,gy.exports=qT()),gy.exports}var V=D0();const Oh=id(V),v$=FT({__proto__:null,default:Oh},[V]);var yy={exports:{}},uh={},_y={exports:{}},by={};var nS;function VT(){return nS||(nS=1,(function(n){function e(Z,ie){var ne=Z.length;Z.push(ie);e:for(;0<ne;){var P=ne-1>>>1,L=Z[P];if(0<r(L,ie))Z[P]=ie,Z[ne]=L,ne=P;else break e}}function t(Z){return Z.length===0?null:Z[0]}function i(Z){if(Z.length===0)return null;var ie=Z[0],ne=Z.pop();if(ne!==ie){Z[0]=ne;e:for(var P=0,L=Z.length,F=L>>>1;P<F;){var $=2*(P+1)-1,W=Z[$],ye=$+1,be=Z[ye];if(0>r(W,ne))ye<L&&0>r(be,W)?(Z[P]=be,Z[ye]=ne,P=ye):(Z[P]=W,Z[$]=ne,P=$);else if(ye<L&&0>r(be,ne))Z[P]=be,Z[ye]=ne,P=ye;else break e}}return ie}function r(Z,ie){var ne=Z.sortIndex-ie.sortIndex;return ne!==0?ne:Z.id-ie.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var l=Date,o=l.now();n.unstable_now=function(){return l.now()-o}}var u=[],h=[],p=1,f=null,m=3,g=!1,_=!1,w=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function C(Z){for(var ie=t(h);ie!==null;){if(ie.callback===null)i(h);else if(ie.startTime<=Z)i(h),ie.sortIndex=ie.expirationTime,e(u,ie);else break;ie=t(h)}}function O(Z){if(w=!1,C(Z),!_)if(t(u)!==null)_=!0,M||(M=!0,K());else{var ie=t(h);ie!==null&&Q(O,ie.startTime-Z)}}var M=!1,D=-1,N=5,B=-1;function U(){return v?!0:!(n.unstable_now()-B<N)}function Y(){if(v=!1,M){var Z=n.unstable_now();B=Z;var ie=!0;try{e:{_=!1,w&&(w=!1,S(D),D=-1),g=!0;var ne=m;try{t:{for(C(Z),f=t(u);f!==null&&!(f.expirationTime>Z&&U());){var P=f.callback;if(typeof P=="function"){f.callback=null,m=f.priorityLevel;var L=P(f.expirationTime<=Z);if(Z=n.unstable_now(),typeof L=="function"){f.callback=L,C(Z),ie=!0;break t}f===t(u)&&i(u),C(Z)}else i(u);f=t(u)}if(f!==null)ie=!0;else{var F=t(h);F!==null&&Q(O,F.startTime-Z),ie=!1}}break e}finally{f=null,m=ne,g=!1}ie=void 0}}finally{ie?K():M=!1}}}var K;if(typeof b=="function")K=function(){b(Y)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,J=H.port2;H.port1.onmessage=Y,K=function(){J.postMessage(null)}}else K=function(){x(Y,0)};function Q(Z,ie){D=x(function(){Z(n.unstable_now())},ie)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Z){Z.callback=null},n.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<Z?Math.floor(1e3/Z):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_next=function(Z){switch(m){case 1:case 2:case 3:var ie=3;break;default:ie=m}var ne=m;m=ie;try{return Z()}finally{m=ne}},n.unstable_requestPaint=function(){v=!0},n.unstable_runWithPriority=function(Z,ie){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ne=m;m=Z;try{return ie()}finally{m=ne}},n.unstable_scheduleCallback=function(Z,ie,ne){var P=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?P+ne:P):ne=P,Z){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ne+L,Z={id:p++,callback:ie,priorityLevel:Z,startTime:ne,expirationTime:L,sortIndex:-1},ne>P?(Z.sortIndex=ne,e(h,Z),t(u)===null&&Z===t(h)&&(w?(S(D),D=-1):w=!0,Q(O,ne-P))):(Z.sortIndex=L,e(u,Z),_||g||(_=!0,M||(M=!0,K()))),Z},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(Z){var ie=m;return function(){var ne=m;m=ie;try{return Z.apply(this,arguments)}finally{m=ne}}}})(by)),by}var iS;function WT(){return iS||(iS=1,_y.exports=VT()),_y.exports}var vy={exports:{}},Wi={};var rS;function $T(){if(rS)return Wi;rS=1;var n=D0();function e(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function a(u,h,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:f==null?null:""+f,children:u,containerInfo:h,implementation:p}}var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Wi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Wi.createPortal=function(u,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(u,h,null,p)},Wi.flushSync=function(u){var h=l.T,p=i.p;try{if(l.T=null,i.p=2,u)return u()}finally{l.T=h,i.p=p,i.d.f()}},Wi.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(u,h))},Wi.prefetchDNS=function(u){typeof u=="string"&&i.d.D(u)},Wi.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var p=h.as,f=o(p,h.crossOrigin),m=typeof h.integrity=="string"?h.integrity:void 0,g=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?i.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:m,fetchPriority:g}):p==="script"&&i.d.X(u,{crossOrigin:f,integrity:m,fetchPriority:g,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Wi.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=o(h.as,h.crossOrigin);i.d.M(u,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(u)},Wi.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,f=o(p,h.crossOrigin);i.d.L(u,p,{crossOrigin:f,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Wi.preloadModule=function(u,h){if(typeof u=="string")if(h){var p=o(h.as,h.crossOrigin);i.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(u)},Wi.requestFormReset=function(u){i.d.r(u)},Wi.unstable_batchedUpdates=function(u,h){return u(h)},Wi.useFormState=function(u,h,p){return l.H.useFormState(u,h,p)},Wi.useFormStatus=function(){return l.H.useHostTransitionStatus()},Wi.version="19.2.4",Wi}var sS;function yE(){if(sS)return vy.exports;sS=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),vy.exports=$T(),vy.exports}var aS;function GT(){if(aS)return uh;aS=1;var n=WT(),e=D0(),t=yE();function i(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var c=s,d=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(d=c.return),s=c.return;while(s)}return c.tag===3?d:null}function l(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function o(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(i(188))}function h(s){var c=s.alternate;if(!c){if(c=a(s),c===null)throw Error(i(188));return c!==s?null:s}for(var d=s,y=c;;){var k=d.return;if(k===null)break;var T=k.alternate;if(T===null){if(y=k.return,y!==null){d=y;continue}break}if(k.child===T.child){for(T=k.child;T;){if(T===d)return u(k),s;if(T===y)return u(k),c;T=T.sibling}throw Error(i(188))}if(d.return!==y.return)d=k,y=T;else{for(var j=!1,X=k.child;X;){if(X===d){j=!0,d=k,y=T;break}if(X===y){j=!0,y=k,d=T;break}X=X.sibling}if(!j){for(X=T.child;X;){if(X===d){j=!0,d=T,y=k;break}if(X===y){j=!0,y=T,d=k;break}X=X.sibling}if(!j)throw Error(i(189))}}if(d.alternate!==y)throw Error(i(190))}if(d.tag!==3)throw Error(i(188));return d.stateNode.current===d?s:c}function p(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=p(s),c!==null)return c;s=s.sibling}return null}var f=Object.assign,m=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),b=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function K(s){return s===null||typeof s!="object"?null:(s=Y&&s[Y]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function J(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case x:return"Profiler";case v:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case _:return"Portal";case b:return s.displayName||"Context";case S:return(s._context.displayName||"Context")+".Consumer";case C:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return c=s.displayName||null,c!==null?c:J(s.type)||"Memo";case N:c=s._payload,s=s._init;try{return J(s(c))}catch{}}return null}var Q=Array.isArray,Z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},P=[],L=-1;function F(s){return{current:s}}function $(s){0>L||(s.current=P[L],P[L]=null,L--)}function W(s,c){L++,P[L]=s.current,s.current=c}var ye=F(null),be=F(null),Ne=F(null),le=F(null);function ee(s,c){switch(W(Ne,c),W(be,s),W(ye,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?xx(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=xx(c),s=Sx(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}$(ye),W(ye,s)}function Ce(){$(ye),$(be),$(Ne)}function xe(s){s.memoizedState!==null&&W(le,s);var c=ye.current,d=Sx(c,s.type);c!==d&&(W(be,s),W(ye,d))}function Ze(s){be.current===s&&($(ye),$(be)),le.current===s&&($(le),sh._currentValue=ne)}var De,wt;function Fe(s){if(De===void 0)try{throw Error()}catch(d){var c=d.stack.trim().match(/\n( *(at )?)/);De=c&&c[1]||"",wt=-1<d.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+De+s+wt}var qe=!1;function ze(s,c){if(!s||qe)return"";qe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(Oe){var Me=Oe}Reflect.construct(s,[],je)}else{try{je.call()}catch(Oe){Me=Oe}s.call(je.prototype)}}else{try{throw Error()}catch(Oe){Me=Oe}(je=s())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(Oe){if(Oe&&Me&&typeof Oe.stack=="string")return[Oe.stack,Me.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=y.DetermineComponentFrameRoot(),j=T[0],X=T[1];if(j&&X){var ae=j.split(`
5
+ `),Ae=X.split(`
6
+ `);for(k=y=0;y<ae.length&&!ae[y].includes("DetermineComponentFrameRoot");)y++;for(;k<Ae.length&&!Ae[k].includes("DetermineComponentFrameRoot");)k++;if(y===ae.length||k===Ae.length)for(y=ae.length-1,k=Ae.length-1;1<=y&&0<=k&&ae[y]!==Ae[k];)k--;for(;1<=y&&0<=k;y--,k--)if(ae[y]!==Ae[k]){if(y!==1||k!==1)do if(y--,k--,0>k||ae[y]!==Ae[k]){var Le=`
7
+ `+ae[y].replace(" at new "," at ");return s.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",s.displayName)),Le}while(1<=y&&0<=k);break}}}finally{qe=!1,Error.prepareStackTrace=d}return(d=s?s.displayName||s.name:"")?Fe(d):""}function Ue(s,c){switch(s.tag){case 26:case 27:case 5:return Fe(s.type);case 16:return Fe("Lazy");case 13:return s.child!==c&&c!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return ze(s.type,!1);case 11:return ze(s.type.render,!1);case 1:return ze(s.type,!0);case 31:return Fe("Activity");default:return""}}function at(s){try{var c="",d=null;do c+=Ue(s,d),d=s,s=s.return;while(s);return c}catch(y){return`
8
+ Error generating stack: `+y.message+`
9
+ `+y.stack}}var Lt=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Tt=n.unstable_cancelCallback,Re=n.unstable_shouldYield,He=n.unstable_requestPaint,st=n.unstable_now,kt=n.unstable_getCurrentPriorityLevel,_e=n.unstable_ImmediatePriority,Ve=n.unstable_UserBlockingPriority,ft=n.unstable_NormalPriority,Et=n.unstable_LowPriority,Pt=n.unstable_IdlePriority,Tn=n.log,Ht=n.unstable_setDisableYieldValue,Pn=null,Un=null;function Vn(s){if(typeof Tn=="function"&&Ht(s),Un&&typeof Un.setStrictMode=="function")try{Un.setStrictMode(Pn,s)}catch{}}var et=Math.clz32?Math.clz32:ia,Fi=Math.log,Jn=Math.LN2;function ia(s){return s>>>=0,s===0?32:31-(Fi(s)/Jn|0)|0}var rt=256,ks=262144,As=4194304;function ki(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function oe(s,c,d){var y=s.pendingLanes;if(y===0)return 0;var k=0,T=s.suspendedLanes,j=s.pingedLanes;s=s.warmLanes;var X=y&134217727;return X!==0?(y=X&~T,y!==0?k=ki(y):(j&=X,j!==0?k=ki(j):d||(d=X&~s,d!==0&&(k=ki(d))))):(X=y&~T,X!==0?k=ki(X):j!==0?k=ki(j):d||(d=y&~s,d!==0&&(k=ki(d)))),k===0?0:c!==0&&c!==k&&(c&T)===0&&(T=k&-k,d=c&-c,T>=d||T===32&&(d&4194048)!==0)?c:k}function Be(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function ot(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Ft(){var s=As;return As<<=1,(As&62914560)===0&&(As=4194304),s}function _n(s){for(var c=[],d=0;31>d;d++)c.push(s);return c}function fn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function _t(s,c,d,y,k,T){var j=s.pendingLanes;s.pendingLanes=d,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=d,s.entangledLanes&=d,s.errorRecoveryDisabledLanes&=d,s.shellSuspendCounter=0;var X=s.entanglements,ae=s.expirationTimes,Ae=s.hiddenUpdates;for(d=j&~d;0<d;){var Le=31-et(d),je=1<<Le;X[Le]=0,ae[Le]=-1;var Me=Ae[Le];if(Me!==null)for(Ae[Le]=null,Le=0;Le<Me.length;Le++){var Oe=Me[Le];Oe!==null&&(Oe.lane&=-536870913)}d&=~je}y!==0&&dt(s,y,0),T!==0&&k===0&&s.tag!==0&&(s.suspendedLanes|=T&~(j&~c))}function dt(s,c,d){s.pendingLanes|=c,s.suspendedLanes&=~c;var y=31-et(c);s.entangledLanes|=c,s.entanglements[y]=s.entanglements[y]|1073741824|d&261930}function ut(s,c){var d=s.entangledLanes|=c;for(s=s.entanglements;d;){var y=31-et(d),k=1<<y;k&c|s[y]&c&&(s[y]|=c),d&=~k}}function nn(s,c){var d=c&-c;return d=(d&42)!==0?1:Hn(d),(d&(s.suspendedLanes|c))!==0?0:d}function Hn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ur(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function rs(){var s=ie.p;return s!==0?s:(s=window.event,s===void 0?32:Wx(s.type))}function ss(s,c){var d=ie.p;try{return ie.p=s,c()}finally{ie.p=d}}var Fr=Math.random().toString(36).slice(2),Mn="__reactFiber$"+Fr,Qn="__reactProps$"+Fr,Di="__reactContainer$"+Fr,Ts="__reactEvents$"+Fr,Dl="__reactListeners$"+Fr,Ji="__reactHandles$"+Fr,jo="__reactResources$"+Fr,Qi="__reactMarker$"+Fr;function Va(s){delete s[Mn],delete s[Qn],delete s[Ts],delete s[Dl],delete s[Ji]}function xi(s){var c=s[Mn];if(c)return c;for(var d=s.parentNode;d;){if(c=d[Di]||d[Mn]){if(d=c.alternate,c.child!==null||d!==null&&d.child!==null)for(s=Mx(s);s!==null;){if(d=s[Mn])return d;s=Mx(s)}return c}s=d,d=s.parentNode}return null}function En(s){if(s=s[Mn]||s[Di]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function ji(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(i(33))}function Ai(s){var c=s[jo];return c||(c=s[jo]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function ei(s){s[Qi]=!0}var as=new Set,jr={};function vr(s,c){Xe(s,c),Xe(s+"Capture",c)}function Xe(s,c){for(jr[s]=c,s=0;s<c.length;s++)as.add(c[s])}var vt=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]*$"),Jt={},pn={};function Yn(s){return Lt.call(pn,s)?!0:Lt.call(Jt,s)?!1:vt.test(s)?pn[s]=!0:(Jt[s]=!0,!1)}function Dt(s,c,d){if(Yn(c))if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+d)}}function Ui(s,c,d){if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+d)}}function Ii(s,c,d,y){if(y===null)s.removeAttribute(d);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(d);return}s.setAttributeNS(c,d,""+y)}}function kn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Si(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Uo(s,c,d){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var k=y.get,T=y.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return k.call(this)},set:function(j){d=""+j,T.call(this,j)}}),Object.defineProperty(s,c,{enumerable:y.enumerable}),{getValue:function(){return d},setValue:function(j){d=""+j},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function ra(s){if(!s._valueTracker){var c=Si(s)?"checked":"value";s._valueTracker=Uo(s,c,""+s[c])}}function Wa(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var d=c.getValue(),y="";return s&&(y=Si(s)?s.checked?"true":"false":s.value),s=y,s!==d?(c.setValue(s),!0):!1}function gn(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var sa=/[\n"\\]/g;function hi(s){return s.replace(sa,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Ur(s,c,d,y,k,T,j,X){s.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?s.type=j:s.removeAttribute("type"),c!=null?j==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+kn(c)):s.value!==""+kn(c)&&(s.value=""+kn(c)):j!=="submit"&&j!=="reset"||s.removeAttribute("value"),c!=null?Ms(s,j,kn(c)):d!=null?Ms(s,j,kn(d)):y!=null&&s.removeAttribute("value"),k==null&&T!=null&&(s.defaultChecked=!!T),k!=null&&(s.checked=k&&typeof k!="function"&&typeof k!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?s.name=""+kn(X):s.removeAttribute("name")}function os(s,c,d,y,k,T,j,X){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),c!=null||d!=null){if(!(T!=="submit"&&T!=="reset"||c!=null)){ra(s);return}d=d!=null?""+kn(d):"",c=c!=null?""+kn(c):d,X||c===s.value||(s.value=c),s.defaultValue=c}y=y??k,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=X?s.checked:!!y,s.defaultChecked=!!y,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(s.name=j),ra(s)}function Ms(s,c,d){c==="number"&&gn(s.ownerDocument)===s||s.defaultValue===""+d||(s.defaultValue=""+d)}function ri(s,c,d,y){if(s=s.options,c){c={};for(var k=0;k<d.length;k++)c["$"+d[k]]=!0;for(d=0;d<s.length;d++)k=c.hasOwnProperty("$"+s[d].value),s[d].selected!==k&&(s[d].selected=k),k&&y&&(s[d].defaultSelected=!0)}else{for(d=""+kn(d),c=null,k=0;k<s.length;k++){if(s[k].value===d){s[k].selected=!0,y&&(s[k].defaultSelected=!0);return}c!==null||s[k].disabled||(c=s[k])}c!==null&&(c.selected=!0)}}function Ho(s,c,d){if(c!=null&&(c=""+kn(c),c!==s.value&&(s.value=c),d==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=d!=null?""+kn(d):""}function ls(s,c,d,y){if(c==null){if(y!=null){if(d!=null)throw Error(i(92));if(Q(y)){if(1<y.length)throw Error(i(93));y=y[0]}d=y}d==null&&(d=""),c=d}d=kn(c),s.defaultValue=d,y=s.textContent,y===d&&y!==""&&y!==null&&(s.value=y),ra(s)}function Rt(s,c){if(c){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=c;return}}s.textContent=c}var Il=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 Ot(s,c,d){var y=c.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?y?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":y?s.setProperty(c,d):typeof d!="number"||d===0||Il.has(c)?c==="float"?s.cssFloat=d:s[c]=(""+d).trim():s[c]=d+"px"}function bn(s,c,d){if(c!=null&&typeof c!="object")throw Error(i(62));if(s=s.style,d!=null){for(var y in d)!d.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var k in c)y=c[k],c.hasOwnProperty(k)&&d[k]!==y&&Ot(s,k,y)}else for(var T in c)c.hasOwnProperty(T)&&Ot(s,T,c[T])}function Rs(s){if(s.indexOf("-")===-1)return!1;switch(s){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 cs=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"]]),wi=/^[\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 er(s){return wi.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function tt(){}var yt=null;function qt(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var rn=null,Yt=null;function ti(s){var c=En(s);if(c&&(s=c.stateNode)){var d=s[Qn]||null;e:switch(s=c.stateNode,c.type){case"input":if(Ur(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),c=d.name,d.type==="radio"&&c!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+hi(""+c)+'"][type="radio"]'),c=0;c<d.length;c++){var y=d[c];if(y!==s&&y.form===s.form){var k=y[Qn]||null;if(!k)throw Error(i(90));Ur(y,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(c=0;c<d.length;c++)y=d[c],y.form===s.form&&Wa(y)}break e;case"textarea":Ho(s,d.value,d.defaultValue);break e;case"select":c=d.value,c!=null&&ri(s,!!d.multiple,c,!1)}}}var us=!1;function Os(s,c,d){if(us)return s(c,d);us=!0;try{var y=s(c);return y}finally{if(us=!1,(rn!==null||Yt!==null)&&(tf(),rn&&(c=rn,s=Yt,Yt=rn=null,ti(c),s)))for(c=0;c<s.length;c++)ti(s[c])}}function aa(s,c){var d=s.stateNode;if(d===null)return null;var y=d[Qn]||null;if(y===null)return null;d=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(i(231,c,typeof d));return d}var Ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(Ti)try{var Hi={};Object.defineProperty(Hi,"passive",{get:function(){yu=!0}}),window.addEventListener("test",Hi,Hi),window.removeEventListener("test",Hi,Hi)}catch{yu=!1}var Hr=null,Ll=null,$a=null;function Ga(){if($a)return $a;var s,c=Ll,d=c.length,y,k="value"in Hr?Hr.value:Hr.textContent,T=k.length;for(s=0;s<d&&c[s]===k[s];s++);var j=d-s;for(y=1;y<=j&&c[d-y]===k[T-y];y++);return $a=k.slice(s,1<y?1-y:void 0)}function Ka(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function qo(){return!0}function fd(){return!1}function di(s){function c(d,y,k,T,j){this._reactName=d,this._targetInst=k,this.type=y,this.nativeEvent=T,this.target=j,this.currentTarget=null;for(var X in s)s.hasOwnProperty(X)&&(d=s[X],this[X]=d?d(T):T[X]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?qo:fd,this.isPropagationStopped=fd,this}return f(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=qo)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=qo)},persist:function(){},isPersistent:qo}),c}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=di(oa),Ns=f({},oa,{view:0,detail:0}),zl=di(Ns),Vo,_u,Wo,Pl=f({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:la,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Wo&&(Wo&&s.type==="mousemove"?(Vo=s.screenX-Wo.screenX,_u=s.screenY-Wo.screenY):_u=Vo=0,Wo=s),Vo)},movementY:function(s){return"movementY"in s?s.movementY:_u}}),Fl=di(Pl),bu=f({},Pl,{dataTransfer:0}),pd=di(bu),jl=f({},Ns,{relatedTarget:0}),Ya=di(jl),Ul=f({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),md=di(Ul),km=f({},oa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Xa=di(km),vu=f({},oa,{data:0}),Hl=di(vu),xu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Su={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"},Mi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $o(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=Mi[s])?!!c[s]:!1}function la(){return $o}var gd=f({},Ns,{key:function(s){if(s.key){var c=xu[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Ka(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Su[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:la,charCode:function(s){return s.type==="keypress"?Ka(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ka(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),ql=di(gd),yd=f({},Pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wu=di(yd),Vl=f({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),Cu=di(Vl),ca=f({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eu=di(ca),ku=f({},Pl,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Wl=di(ku),Au=f({},oa,{newState:0,oldState:0}),_d=di(Au),Am=[9,13,27,32],Go=Ti&&"CompositionEvent"in window,Ds=null;Ti&&"documentMode"in document&&(Ds=document.documentMode);var Tm=Ti&&"TextEvent"in window&&!Ds,$l=Ti&&(!Go||Ds&&8<Ds&&11>=Ds),Gl=" ",bd=!1;function Tu(s,c){switch(s){case"keyup":return Am.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ua=!1;function xd(s,c){switch(s){case"compositionend":return vd(c);case"keypress":return c.which!==32?null:(bd=!0,Gl);case"textInput":return s=c.data,s===Gl&&bd?null:s;default:return null}}function Mm(s,c){if(ua)return s==="compositionend"||!Go&&Tu(s,c)?(s=Ga(),$a=Ll=Hr=null,ua=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return $l&&c.locale!=="ko"?null:c.data;default:return null}}var Sd={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 Kl(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!Sd[s.type]:c==="textarea"}function Mu(s,c,d,y){rn?Yt?Yt.push(y):Yt=[y]:rn=y,c=cf(c,"onChange"),0<c.length&&(d=new Bl("onChange","change",null,d,y),s.push({event:d,listeners:c}))}var Za=null,Ko=null;function Rm(s){mx(s,0)}function Yl(s){var c=ji(s);if(Wa(c))return s}function Yo(s,c){if(s==="change")return c}var qr=!1;if(Ti){var Wn;if(Ti){var Ja="oninput"in document;if(!Ja){var ha=document.createElement("div");ha.setAttribute("oninput","return;"),Ja=typeof ha.oninput=="function"}Wn=Ja}else Wn=!1;qr=Wn&&(!document.documentMode||9<document.documentMode)}function wd(){Za&&(Za.detachEvent("onpropertychange",Xl),Ko=Za=null)}function Xl(s){if(s.propertyName==="value"&&Yl(Ko)){var c=[];Mu(c,Ko,s,qt(s)),Os(Rm,c)}}function Cd(s,c,d){s==="focusin"?(wd(),Za=c,Ko=d,Za.attachEvent("onpropertychange",Xl)):s==="focusout"&&wd()}function da(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Yl(Ko)}function Ru(s,c){if(s==="click")return Yl(c)}function Qa(s,c){if(s==="input"||s==="change")return Yl(c)}function Is(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var qi=typeof Object.is=="function"?Object.is:Is;function E(s,c){if(qi(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var d=Object.keys(s),y=Object.keys(c);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++){var k=d[y];if(!Lt.call(c,k)||!qi(s[k],c[k]))return!1}return!0}function R(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function I(s,c){var d=R(s);s=0;for(var y;d;){if(d.nodeType===3){if(y=s+d.textContent.length,s<=c&&y>=c)return{node:d,offset:c-s};s=y}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=R(d)}}function z(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?z(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function q(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=gn(s.document);c instanceof s.HTMLIFrameElement;){try{var d=typeof c.contentWindow.location.href=="string"}catch{d=!1}if(d)s=c.contentWindow;else break;c=gn(s.document)}return c}function G(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var te=Ti&&"documentMode"in document&&11>=document.documentMode,re=null,ue=null,Se=null,he=!1;function ce(s,c,d){var y=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;he||re==null||re!==gn(y)||(y=re,"selectionStart"in y&&G(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Se&&E(Se,y)||(Se=y,y=cf(ue,"onSelect"),0<y.length&&(c=new Bl("onSelect","select",null,c,d),s.push({event:c,listeners:y}),c.target=re)))}function pe(s,c){var d={};return d[s.toLowerCase()]=c.toLowerCase(),d["Webkit"+s]="webkit"+c,d["Moz"+s]="moz"+c,d}var ge={animationend:pe("Animation","AnimationEnd"),animationiteration:pe("Animation","AnimationIteration"),animationstart:pe("Animation","AnimationStart"),transitionrun:pe("Transition","TransitionRun"),transitionstart:pe("Transition","TransitionStart"),transitioncancel:pe("Transition","TransitionCancel"),transitionend:pe("Transition","TransitionEnd")},de={},fe={};Ti&&(fe=document.createElement("div").style,"AnimationEvent"in window||(delete ge.animationend.animation,delete ge.animationiteration.animation,delete ge.animationstart.animation),"TransitionEvent"in window||delete ge.transitionend.transition);function Ee(s){if(de[s])return de[s];if(!ge[s])return s;var c=ge[s],d;for(d in c)if(c.hasOwnProperty(d)&&d in fe)return de[s]=c[d];return s}var Te=Ee("animationend"),we=Ee("animationiteration"),Ie=Ee("animationstart"),$e=Ee("transitionrun"),nt=Ee("transitionstart"),it=Ee("transitioncancel"),Ge=Ee("transitionend"),pt=new Map,ct="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(" ");ct.push("scrollEnd");function Ke(s,c){pt.set(s,c),vr(c,[s])}var mt=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ut=[],sn=0,At=0;function Wt(){for(var s=sn,c=At=sn=0;c<s;){var d=Ut[c];Ut[c++]=null;var y=Ut[c];Ut[c++]=null;var k=Ut[c];Ut[c++]=null;var T=Ut[c];if(Ut[c++]=null,y!==null&&k!==null){var j=y.pending;j===null?k.next=k:(k.next=j.next,j.next=k),y.pending=k}T!==0&&Ls(d,k,T)}}function Dn(s,c,d,y){Ut[sn++]=s,Ut[sn++]=c,Ut[sn++]=d,Ut[sn++]=y,At|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function Vi(s,c,d,y){return Dn(s,c,d,y),eo(s)}function Rn(s,c){return Dn(s,null,null,c),eo(s)}function Ls(s,c,d){s.lanes|=d;var y=s.alternate;y!==null&&(y.lanes|=d);for(var k=!1,T=s.return;T!==null;)T.childLanes|=d,y=T.alternate,y!==null&&(y.childLanes|=d),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(k=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,k&&c!==null&&(k=31-et(d),s=T.hiddenUpdates,y=s[k],y===null?s[k]=[c]:y.push(c),c.lane=d|536870912),T):null}function eo(s){if(50<Ju)throw Ju=0,Fg=null,Error(i(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var Zl={};function SA(s,c,d,y){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xr(s,c,d,y){return new SA(s,c,d,y)}function Om(s){return s=s.prototype,!(!s||!s.isReactComponent)}function fa(s,c){var d=s.alternate;return d===null?(d=xr(s.tag,c,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=c,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&65011712,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,c=s.dependencies,d.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d.refCleanup=s.refCleanup,d}function Zb(s,c){s.flags&=65011714;var d=s.alternate;return d===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=d.childLanes,s.lanes=d.lanes,s.child=d.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=d.memoizedProps,s.memoizedState=d.memoizedState,s.updateQueue=d.updateQueue,s.type=d.type,c=d.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function Ed(s,c,d,y,k,T){var j=0;if(y=s,typeof s=="function")Om(s)&&(j=1);else if(typeof s=="string")j=AT(s,d,ye.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=xr(31,d,c,k),s.elementType=B,s.lanes=T,s;case w:return Xo(d.children,k,T,c);case v:j=8,k|=24;break;case x:return s=xr(12,d,c,k|2),s.elementType=x,s.lanes=T,s;case O:return s=xr(13,d,c,k),s.elementType=O,s.lanes=T,s;case M:return s=xr(19,d,c,k),s.elementType=M,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case b:j=10;break e;case S:j=9;break e;case C:j=11;break e;case D:j=14;break e;case N:j=16,y=null;break e}j=29,d=Error(i(130,s===null?"null":typeof s,"")),y=null}return c=xr(j,d,c,k),c.elementType=s,c.type=y,c.lanes=T,c}function Xo(s,c,d,y){return s=xr(7,s,y,c),s.lanes=d,s}function Nm(s,c,d){return s=xr(6,s,null,c),s.lanes=d,s}function Jb(s){var c=xr(18,null,null,0);return c.stateNode=s,c}function Dm(s,c,d){return c=xr(4,s.children!==null?s.children:[],s.key,c),c.lanes=d,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var Qb=new WeakMap;function Vr(s,c){if(typeof s=="object"&&s!==null){var d=Qb.get(s);return d!==void 0?d:(c={value:s,source:c,stack:at(c)},Qb.set(s,c),c)}return{value:s,source:c,stack:at(c)}}var Jl=[],Ql=0,kd=null,Ou=0,Wr=[],$r=0,to=null,Bs=1,zs="";function pa(s,c){Jl[Ql++]=Ou,Jl[Ql++]=kd,kd=s,Ou=c}function ev(s,c,d){Wr[$r++]=Bs,Wr[$r++]=zs,Wr[$r++]=to,to=s;var y=Bs;s=zs;var k=32-et(y)-1;y&=~(1<<k),d+=1;var T=32-et(c)+k;if(30<T){var j=k-k%5;T=(y&(1<<j)-1).toString(32),y>>=j,k-=j,Bs=1<<32-et(c)+k|d<<k|y,zs=T+s}else Bs=1<<T|d<<k|y,zs=s}function Im(s){s.return!==null&&(pa(s,1),ev(s,1,0))}function Lm(s){for(;s===kd;)kd=Jl[--Ql],Jl[Ql]=null,Ou=Jl[--Ql],Jl[Ql]=null;for(;s===to;)to=Wr[--$r],Wr[$r]=null,zs=Wr[--$r],Wr[$r]=null,Bs=Wr[--$r],Wr[$r]=null}function tv(s,c){Wr[$r++]=Bs,Wr[$r++]=zs,Wr[$r++]=to,Bs=c.id,zs=c.overflow,to=s}var Li=null,$n=null,dn=!1,no=null,Gr=!1,Bm=Error(i(519));function io(s){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nu(Vr(c,s)),Bm}function nv(s){var c=s.stateNode,d=s.type,y=s.memoizedProps;switch(c[Mn]=s,c[Qn]=y,d){case"dialog":ln("cancel",c),ln("close",c);break;case"iframe":case"object":case"embed":ln("load",c);break;case"video":case"audio":for(d=0;d<eh.length;d++)ln(eh[d],c);break;case"source":ln("error",c);break;case"img":case"image":case"link":ln("error",c),ln("load",c);break;case"details":ln("toggle",c);break;case"input":ln("invalid",c),os(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":ln("invalid",c);break;case"textarea":ln("invalid",c),ls(c,y.value,y.defaultValue,y.children)}d=y.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||c.textContent===""+d||y.suppressHydrationWarning===!0||bx(c.textContent,d)?(y.popover!=null&&(ln("beforetoggle",c),ln("toggle",c)),y.onScroll!=null&&ln("scroll",c),y.onScrollEnd!=null&&ln("scrollend",c),y.onClick!=null&&(c.onclick=tt),c=!0):c=!1,c||io(s,!0)}function iv(s){for(Li=s.return;Li;)switch(Li.tag){case 5:case 31:case 13:Gr=!1;return;case 27:case 3:Gr=!0;return;default:Li=Li.return}}function ec(s){if(s!==Li)return!1;if(!dn)return iv(s),dn=!0,!1;var c=s.tag,d;if((d=c!==3&&c!==27)&&((d=c===5)&&(d=s.type,d=!(d!=="form"&&d!=="button")||ey(s.type,s.memoizedProps)),d=!d),d&&$n&&io(s),iv(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));$n=Tx(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));$n=Tx(s)}else c===27?(c=$n,_o(s.type)?(s=sy,sy=null,$n=s):$n=c):$n=Li?Yr(s.stateNode.nextSibling):null;return!0}function Zo(){$n=Li=null,dn=!1}function zm(){var s=no;return s!==null&&(pr===null?pr=s:pr.push.apply(pr,s),no=null),s}function Nu(s){no===null?no=[s]:no.push(s)}var Pm=F(null),Jo=null,ma=null;function ro(s,c,d){W(Pm,c._currentValue),c._currentValue=d}function ga(s){s._currentValue=Pm.current,$(Pm)}function Fm(s,c,d){for(;s!==null;){var y=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),s===d)break;s=s.return}}function jm(s,c,d,y){var k=s.child;for(k!==null&&(k.return=s);k!==null;){var T=k.dependencies;if(T!==null){var j=k.child;T=T.firstContext;e:for(;T!==null;){var X=T;T=k;for(var ae=0;ae<c.length;ae++)if(X.context===c[ae]){T.lanes|=d,X=T.alternate,X!==null&&(X.lanes|=d),Fm(T.return,d,s),y||(j=null);break e}T=X.next}}else if(k.tag===18){if(j=k.return,j===null)throw Error(i(341));j.lanes|=d,T=j.alternate,T!==null&&(T.lanes|=d),Fm(j,d,s),j=null}else j=k.child;if(j!==null)j.return=k;else for(j=k;j!==null;){if(j===s){j=null;break}if(k=j.sibling,k!==null){k.return=j.return,j=k;break}j=j.return}k=j}}function tc(s,c,d,y){s=null;for(var k=c,T=!1;k!==null;){if(!T){if((k.flags&524288)!==0)T=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var j=k.alternate;if(j===null)throw Error(i(387));if(j=j.memoizedProps,j!==null){var X=k.type;qi(k.pendingProps.value,j.value)||(s!==null?s.push(X):s=[X])}}else if(k===le.current){if(j=k.alternate,j===null)throw Error(i(387));j.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(s!==null?s.push(sh):s=[sh])}k=k.return}s!==null&&jm(c,s,d,y),c.flags|=262144}function Ad(s){for(s=s.firstContext;s!==null;){if(!qi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Qo(s){Jo=s,ma=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Bi(s){return rv(Jo,s)}function Td(s,c){return Jo===null&&Qo(s),rv(s,c)}function rv(s,c){var d=c._currentValue;if(c={context:c,memoizedValue:d,next:null},ma===null){if(s===null)throw Error(i(308));ma=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else ma=ma.next=c;return d}var wA=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(d,y){s.push(y)}};this.abort=function(){c.aborted=!0,s.forEach(function(d){return d()})}},CA=n.unstable_scheduleCallback,EA=n.unstable_NormalPriority,fi={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Um(){return{controller:new wA,data:new Map,refCount:0}}function Du(s){s.refCount--,s.refCount===0&&CA(EA,function(){s.controller.abort()})}var Iu=null,Hm=0,nc=0,ic=null;function kA(s,c){if(Iu===null){var d=Iu=[];Hm=0,nc=Wg(),ic={status:"pending",value:void 0,then:function(y){d.push(y)}}}return Hm++,c.then(sv,sv),c}function sv(){if(--Hm===0&&Iu!==null){ic!==null&&(ic.status="fulfilled");var s=Iu;Iu=null,nc=0,ic=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function AA(s,c){var d=[],y={status:"pending",value:null,reason:null,then:function(k){d.push(k)}};return s.then(function(){y.status="fulfilled",y.value=c;for(var k=0;k<d.length;k++)(0,d[k])(c)},function(k){for(y.status="rejected",y.reason=k,k=0;k<d.length;k++)(0,d[k])(void 0)}),y}var av=Z.S;Z.S=function(s,c){q1=st(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&kA(s,c),av!==null&&av(s,c)};var el=F(null);function qm(){var s=el.current;return s!==null?s:Fn.pooledCache}function Md(s,c){c===null?W(el,el.current):W(el,c.pool)}function ov(){var s=qm();return s===null?null:{parent:fi._currentValue,pool:s}}var rc=Error(i(460)),Vm=Error(i(474)),Rd=Error(i(542)),Od={then:function(){}};function lv(s){return s=s.status,s==="fulfilled"||s==="rejected"}function cv(s,c,d){switch(d=s[d],d===void 0?s.push(c):d!==c&&(c.then(tt,tt),c=d),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,hv(s),s;default:if(typeof c.status=="string")c.then(tt,tt);else{if(s=Fn,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=c,s.status="pending",s.then(function(y){if(c.status==="pending"){var k=c;k.status="fulfilled",k.value=y}},function(y){if(c.status==="pending"){var k=c;k.status="rejected",k.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,hv(s),s}throw nl=c,rc}}function tl(s){try{var c=s._init;return c(s._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(nl=d,rc):d}}var nl=null;function uv(){if(nl===null)throw Error(i(459));var s=nl;return nl=null,s}function hv(s){if(s===rc||s===Rd)throw Error(i(483))}var sc=null,Lu=0;function Nd(s){var c=Lu;return Lu+=1,sc===null&&(sc=[]),cv(sc,s,c)}function Bu(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function Dd(s,c){throw c.$$typeof===m?Error(i(525)):(s=Object.prototype.toString.call(c),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function dv(s){function c(ve,me){if(s){var ke=ve.deletions;ke===null?(ve.deletions=[me],ve.flags|=16):ke.push(me)}}function d(ve,me){if(!s)return null;for(;me!==null;)c(ve,me),me=me.sibling;return null}function y(ve){for(var me=new Map;ve!==null;)ve.key!==null?me.set(ve.key,ve):me.set(ve.index,ve),ve=ve.sibling;return me}function k(ve,me){return ve=fa(ve,me),ve.index=0,ve.sibling=null,ve}function T(ve,me,ke){return ve.index=ke,s?(ke=ve.alternate,ke!==null?(ke=ke.index,ke<me?(ve.flags|=67108866,me):ke):(ve.flags|=67108866,me)):(ve.flags|=1048576,me)}function j(ve){return s&&ve.alternate===null&&(ve.flags|=67108866),ve}function X(ve,me,ke,Pe){return me===null||me.tag!==6?(me=Nm(ke,ve.mode,Pe),me.return=ve,me):(me=k(me,ke),me.return=ve,me)}function ae(ve,me,ke,Pe){var Mt=ke.type;return Mt===w?Le(ve,me,ke.props.children,Pe,ke.key):me!==null&&(me.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===N&&tl(Mt)===me.type)?(me=k(me,ke.props),Bu(me,ke),me.return=ve,me):(me=Ed(ke.type,ke.key,ke.props,null,ve.mode,Pe),Bu(me,ke),me.return=ve,me)}function Ae(ve,me,ke,Pe){return me===null||me.tag!==4||me.stateNode.containerInfo!==ke.containerInfo||me.stateNode.implementation!==ke.implementation?(me=Dm(ke,ve.mode,Pe),me.return=ve,me):(me=k(me,ke.children||[]),me.return=ve,me)}function Le(ve,me,ke,Pe,Mt){return me===null||me.tag!==7?(me=Xo(ke,ve.mode,Pe,Mt),me.return=ve,me):(me=k(me,ke),me.return=ve,me)}function je(ve,me,ke){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return me=Nm(""+me,ve.mode,ke),me.return=ve,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return ke=Ed(me.type,me.key,me.props,null,ve.mode,ke),Bu(ke,me),ke.return=ve,ke;case _:return me=Dm(me,ve.mode,ke),me.return=ve,me;case N:return me=tl(me),je(ve,me,ke)}if(Q(me)||K(me))return me=Xo(me,ve.mode,ke,null),me.return=ve,me;if(typeof me.then=="function")return je(ve,Nd(me),ke);if(me.$$typeof===b)return je(ve,Td(ve,me),ke);Dd(ve,me)}return null}function Me(ve,me,ke,Pe){var Mt=me!==null?me.key:null;if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return Mt!==null?null:X(ve,me,""+ke,Pe);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case g:return ke.key===Mt?ae(ve,me,ke,Pe):null;case _:return ke.key===Mt?Ae(ve,me,ke,Pe):null;case N:return ke=tl(ke),Me(ve,me,ke,Pe)}if(Q(ke)||K(ke))return Mt!==null?null:Le(ve,me,ke,Pe,null);if(typeof ke.then=="function")return Me(ve,me,Nd(ke),Pe);if(ke.$$typeof===b)return Me(ve,me,Td(ve,ke),Pe);Dd(ve,ke)}return null}function Oe(ve,me,ke,Pe,Mt){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint")return ve=ve.get(ke)||null,X(me,ve,""+Pe,Mt);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case g:return ve=ve.get(Pe.key===null?ke:Pe.key)||null,ae(me,ve,Pe,Mt);case _:return ve=ve.get(Pe.key===null?ke:Pe.key)||null,Ae(me,ve,Pe,Mt);case N:return Pe=tl(Pe),Oe(ve,me,ke,Pe,Mt)}if(Q(Pe)||K(Pe))return ve=ve.get(ke)||null,Le(me,ve,Pe,Mt,null);if(typeof Pe.then=="function")return Oe(ve,me,ke,Nd(Pe),Mt);if(Pe.$$typeof===b)return Oe(ve,me,ke,Td(me,Pe),Mt);Dd(me,Pe)}return null}function bt(ve,me,ke,Pe){for(var Mt=null,vn=null,Ct=me,Qt=me=0,hn=null;Ct!==null&&Qt<ke.length;Qt++){Ct.index>Qt?(hn=Ct,Ct=null):hn=Ct.sibling;var xn=Me(ve,Ct,ke[Qt],Pe);if(xn===null){Ct===null&&(Ct=hn);break}s&&Ct&&xn.alternate===null&&c(ve,Ct),me=T(xn,me,Qt),vn===null?Mt=xn:vn.sibling=xn,vn=xn,Ct=hn}if(Qt===ke.length)return d(ve,Ct),dn&&pa(ve,Qt),Mt;if(Ct===null){for(;Qt<ke.length;Qt++)Ct=je(ve,ke[Qt],Pe),Ct!==null&&(me=T(Ct,me,Qt),vn===null?Mt=Ct:vn.sibling=Ct,vn=Ct);return dn&&pa(ve,Qt),Mt}for(Ct=y(Ct);Qt<ke.length;Qt++)hn=Oe(Ct,ve,Qt,ke[Qt],Pe),hn!==null&&(s&&hn.alternate!==null&&Ct.delete(hn.key===null?Qt:hn.key),me=T(hn,me,Qt),vn===null?Mt=hn:vn.sibling=hn,vn=hn);return s&&Ct.forEach(function(wo){return c(ve,wo)}),dn&&pa(ve,Qt),Mt}function Bt(ve,me,ke,Pe){if(ke==null)throw Error(i(151));for(var Mt=null,vn=null,Ct=me,Qt=me=0,hn=null,xn=ke.next();Ct!==null&&!xn.done;Qt++,xn=ke.next()){Ct.index>Qt?(hn=Ct,Ct=null):hn=Ct.sibling;var wo=Me(ve,Ct,xn.value,Pe);if(wo===null){Ct===null&&(Ct=hn);break}s&&Ct&&wo.alternate===null&&c(ve,Ct),me=T(wo,me,Qt),vn===null?Mt=wo:vn.sibling=wo,vn=wo,Ct=hn}if(xn.done)return d(ve,Ct),dn&&pa(ve,Qt),Mt;if(Ct===null){for(;!xn.done;Qt++,xn=ke.next())xn=je(ve,xn.value,Pe),xn!==null&&(me=T(xn,me,Qt),vn===null?Mt=xn:vn.sibling=xn,vn=xn);return dn&&pa(ve,Qt),Mt}for(Ct=y(Ct);!xn.done;Qt++,xn=ke.next())xn=Oe(Ct,ve,Qt,xn.value,Pe),xn!==null&&(s&&xn.alternate!==null&&Ct.delete(xn.key===null?Qt:xn.key),me=T(xn,me,Qt),vn===null?Mt=xn:vn.sibling=xn,vn=xn);return s&&Ct.forEach(function(PT){return c(ve,PT)}),dn&&pa(ve,Qt),Mt}function Bn(ve,me,ke,Pe){if(typeof ke=="object"&&ke!==null&&ke.type===w&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case g:e:{for(var Mt=ke.key;me!==null;){if(me.key===Mt){if(Mt=ke.type,Mt===w){if(me.tag===7){d(ve,me.sibling),Pe=k(me,ke.props.children),Pe.return=ve,ve=Pe;break e}}else if(me.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===N&&tl(Mt)===me.type){d(ve,me.sibling),Pe=k(me,ke.props),Bu(Pe,ke),Pe.return=ve,ve=Pe;break e}d(ve,me);break}else c(ve,me);me=me.sibling}ke.type===w?(Pe=Xo(ke.props.children,ve.mode,Pe,ke.key),Pe.return=ve,ve=Pe):(Pe=Ed(ke.type,ke.key,ke.props,null,ve.mode,Pe),Bu(Pe,ke),Pe.return=ve,ve=Pe)}return j(ve);case _:e:{for(Mt=ke.key;me!==null;){if(me.key===Mt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){d(ve,me.sibling),Pe=k(me,ke.children||[]),Pe.return=ve,ve=Pe;break e}else{d(ve,me);break}else c(ve,me);me=me.sibling}Pe=Dm(ke,ve.mode,Pe),Pe.return=ve,ve=Pe}return j(ve);case N:return ke=tl(ke),Bn(ve,me,ke,Pe)}if(Q(ke))return bt(ve,me,ke,Pe);if(K(ke)){if(Mt=K(ke),typeof Mt!="function")throw Error(i(150));return ke=Mt.call(ke),Bt(ve,me,ke,Pe)}if(typeof ke.then=="function")return Bn(ve,me,Nd(ke),Pe);if(ke.$$typeof===b)return Bn(ve,me,Td(ve,ke),Pe);Dd(ve,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(d(ve,me.sibling),Pe=k(me,ke),Pe.return=ve,ve=Pe):(d(ve,me),Pe=Nm(ke,ve.mode,Pe),Pe.return=ve,ve=Pe),j(ve)):d(ve,me)}return function(ve,me,ke,Pe){try{Lu=0;var Mt=Bn(ve,me,ke,Pe);return sc=null,Mt}catch(Ct){if(Ct===rc||Ct===Rd)throw Ct;var vn=xr(29,Ct,null,ve.mode);return vn.lanes=Pe,vn.return=ve,vn}}}var il=dv(!0),fv=dv(!1),so=!1;function Wm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $m(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ao(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function oo(s,c,d){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(An&2)!==0){var k=y.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),y.pending=c,c=eo(s),Ls(s,null,d),c}return Dn(s,y,c,d),eo(s)}function zu(s,c,d){if(c=c.updateQueue,c!==null&&(c=c.shared,(d&4194048)!==0)){var y=c.lanes;y&=s.pendingLanes,d|=y,c.lanes=d,ut(s,d)}}function Gm(s,c){var d=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var k=null,T=null;if(d=d.firstBaseUpdate,d!==null){do{var j={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};T===null?k=T=j:T=T.next=j,d=d.next}while(d!==null);T===null?k=T=c:T=T.next=c}else k=T=c;d={baseState:y.baseState,firstBaseUpdate:k,lastBaseUpdate:T,shared:y.shared,callbacks:y.callbacks},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=c}var Km=!1;function Pu(){if(Km){var s=ic;if(s!==null)throw s}}function Fu(s,c,d,y){Km=!1;var k=s.updateQueue;so=!1;var T=k.firstBaseUpdate,j=k.lastBaseUpdate,X=k.shared.pending;if(X!==null){k.shared.pending=null;var ae=X,Ae=ae.next;ae.next=null,j===null?T=Ae:j.next=Ae,j=ae;var Le=s.alternate;Le!==null&&(Le=Le.updateQueue,X=Le.lastBaseUpdate,X!==j&&(X===null?Le.firstBaseUpdate=Ae:X.next=Ae,Le.lastBaseUpdate=ae))}if(T!==null){var je=k.baseState;j=0,Le=Ae=ae=null,X=T;do{var Me=X.lane&-536870913,Oe=Me!==X.lane;if(Oe?(un&Me)===Me:(y&Me)===Me){Me!==0&&Me===nc&&(Km=!0),Le!==null&&(Le=Le.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var bt=s,Bt=X;Me=c;var Bn=d;switch(Bt.tag){case 1:if(bt=Bt.payload,typeof bt=="function"){je=bt.call(Bn,je,Me);break e}je=bt;break e;case 3:bt.flags=bt.flags&-65537|128;case 0:if(bt=Bt.payload,Me=typeof bt=="function"?bt.call(Bn,je,Me):bt,Me==null)break e;je=f({},je,Me);break e;case 2:so=!0}}Me=X.callback,Me!==null&&(s.flags|=64,Oe&&(s.flags|=8192),Oe=k.callbacks,Oe===null?k.callbacks=[Me]:Oe.push(Me))}else Oe={lane:Me,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Le===null?(Ae=Le=Oe,ae=je):Le=Le.next=Oe,j|=Me;if(X=X.next,X===null){if(X=k.shared.pending,X===null)break;Oe=X,X=Oe.next,Oe.next=null,k.lastBaseUpdate=Oe,k.shared.pending=null}}while(!0);Le===null&&(ae=je),k.baseState=ae,k.firstBaseUpdate=Ae,k.lastBaseUpdate=Le,T===null&&(k.shared.lanes=0),fo|=j,s.lanes=j,s.memoizedState=je}}function pv(s,c){if(typeof s!="function")throw Error(i(191,s));s.call(c)}function mv(s,c){var d=s.callbacks;if(d!==null)for(s.callbacks=null,s=0;s<d.length;s++)pv(d[s],c)}var ac=F(null),Id=F(0);function gv(s,c){s=Ea,W(Id,s),W(ac,c),Ea=s|c.baseLanes}function Ym(){W(Id,Ea),W(ac,ac.current)}function Xm(){Ea=Id.current,$(ac),$(Id)}var Sr=F(null),Kr=null;function lo(s){var c=s.alternate;W(li,li.current&1),W(Sr,s),Kr===null&&(c===null||ac.current!==null||c.memoizedState!==null)&&(Kr=s)}function Zm(s){W(li,li.current),W(Sr,s),Kr===null&&(Kr=s)}function yv(s){s.tag===22?(W(li,li.current),W(Sr,s),Kr===null&&(Kr=s)):co()}function co(){W(li,li.current),W(Sr,Sr.current)}function wr(s){$(Sr),Kr===s&&(Kr=null),$(li)}var li=F(0);function Ld(s){for(var c=s;c!==null;){if(c.tag===13){var d=c.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||iy(d)||ry(d)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ya=0,Xt=null,In=null,pi=null,Bd=!1,oc=!1,rl=!1,zd=0,ju=0,lc=null,TA=0;function si(){throw Error(i(321))}function Jm(s,c){if(c===null)return!1;for(var d=0;d<c.length&&d<s.length;d++)if(!qi(s[d],c[d]))return!1;return!0}function Qm(s,c,d,y,k,T){return ya=T,Xt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Z.H=s===null||s.memoizedState===null?e1:pg,rl=!1,T=d(y,k),rl=!1,oc&&(T=bv(c,d,y,k)),_v(s),T}function _v(s){Z.H=qu;var c=In!==null&&In.next!==null;if(ya=0,pi=In=Xt=null,Bd=!1,ju=0,lc=null,c)throw Error(i(300));s===null||mi||(s=s.dependencies,s!==null&&Ad(s)&&(mi=!0))}function bv(s,c,d,y){Xt=s;var k=0;do{if(oc&&(lc=null),ju=0,oc=!1,25<=k)throw Error(i(301));if(k+=1,pi=In=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}Z.H=t1,T=c(d,y)}while(oc);return T}function MA(){var s=Z.H,c=s.useState()[0];return c=typeof c.then=="function"?Uu(c):c,s=s.useState()[0],(In!==null?In.memoizedState:null)!==s&&(Xt.flags|=1024),c}function eg(){var s=zd!==0;return zd=0,s}function tg(s,c,d){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~d}function ng(s){if(Bd){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Bd=!1}ya=0,pi=In=Xt=null,oc=!1,ju=zd=0,lc=null}function tr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pi===null?Xt.memoizedState=pi=s:pi=pi.next=s,pi}function ci(){if(In===null){var s=Xt.alternate;s=s!==null?s.memoizedState:null}else s=In.next;var c=pi===null?Xt.memoizedState:pi.next;if(c!==null)pi=c,In=s;else{if(s===null)throw Xt.alternate===null?Error(i(467)):Error(i(310));In=s,s={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},pi===null?Xt.memoizedState=pi=s:pi=pi.next=s}return pi}function Pd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uu(s){var c=ju;return ju+=1,lc===null&&(lc=[]),s=cv(lc,s,c),c=Xt,(pi===null?c.memoizedState:pi.next)===null&&(c=c.alternate,Z.H=c===null||c.memoizedState===null?e1:pg),s}function Fd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Uu(s);if(s.$$typeof===b)return Bi(s)}throw Error(i(438,String(s)))}function ig(s){var c=null,d=Xt.updateQueue;if(d!==null&&(c=d.memoCache),c==null){var y=Xt.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(k){return k.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),d===null&&(d=Pd(),Xt.updateQueue=d),d.memoCache=c,d=c.data[c.index],d===void 0)for(d=c.data[c.index]=Array(s),y=0;y<s;y++)d[y]=U;return c.index++,d}function _a(s,c){return typeof c=="function"?c(s):c}function jd(s){var c=ci();return rg(c,In,s)}function rg(s,c,d){var y=s.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=d;var k=s.baseQueue,T=y.pending;if(T!==null){if(k!==null){var j=k.next;k.next=T.next,T.next=j}c.baseQueue=k=T,y.pending=null}if(T=s.baseState,k===null)s.memoizedState=T;else{c=k.next;var X=j=null,ae=null,Ae=c,Le=!1;do{var je=Ae.lane&-536870913;if(je!==Ae.lane?(un&je)===je:(ya&je)===je){var Me=Ae.revertLane;if(Me===0)ae!==null&&(ae=ae.next={lane:0,revertLane:0,gesture:null,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null}),je===nc&&(Le=!0);else if((ya&Me)===Me){Ae=Ae.next,Me===nc&&(Le=!0);continue}else je={lane:0,revertLane:Ae.revertLane,gesture:null,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null},ae===null?(X=ae=je,j=T):ae=ae.next=je,Xt.lanes|=Me,fo|=Me;je=Ae.action,rl&&d(T,je),T=Ae.hasEagerState?Ae.eagerState:d(T,je)}else Me={lane:je,revertLane:Ae.revertLane,gesture:Ae.gesture,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null},ae===null?(X=ae=Me,j=T):ae=ae.next=Me,Xt.lanes|=je,fo|=je;Ae=Ae.next}while(Ae!==null&&Ae!==c);if(ae===null?j=T:ae.next=X,!qi(T,s.memoizedState)&&(mi=!0,Le&&(d=ic,d!==null)))throw d;s.memoizedState=T,s.baseState=j,s.baseQueue=ae,y.lastRenderedState=T}return k===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function sg(s){var c=ci(),d=c.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=s;var y=d.dispatch,k=d.pending,T=c.memoizedState;if(k!==null){d.pending=null;var j=k=k.next;do T=s(T,j.action),j=j.next;while(j!==k);qi(T,c.memoizedState)||(mi=!0),c.memoizedState=T,c.baseQueue===null&&(c.baseState=T),d.lastRenderedState=T}return[T,y]}function vv(s,c,d){var y=Xt,k=ci(),T=dn;if(T){if(d===void 0)throw Error(i(407));d=d()}else d=c();var j=!qi((In||k).memoizedState,d);if(j&&(k.memoizedState=d,mi=!0),k=k.queue,lg(wv.bind(null,y,k,s),[s]),k.getSnapshot!==c||j||pi!==null&&pi.memoizedState.tag&1){if(y.flags|=2048,cc(9,{destroy:void 0},Sv.bind(null,y,k,d,c),null),Fn===null)throw Error(i(349));T||(ya&127)!==0||xv(y,c,d)}return d}function xv(s,c,d){s.flags|=16384,s={getSnapshot:c,value:d},c=Xt.updateQueue,c===null?(c=Pd(),Xt.updateQueue=c,c.stores=[s]):(d=c.stores,d===null?c.stores=[s]:d.push(s))}function Sv(s,c,d,y){c.value=d,c.getSnapshot=y,Cv(c)&&Ev(s)}function wv(s,c,d){return d(function(){Cv(c)&&Ev(s)})}function Cv(s){var c=s.getSnapshot;s=s.value;try{var d=c();return!qi(s,d)}catch{return!0}}function Ev(s){var c=Rn(s,2);c!==null&&mr(c,s,2)}function ag(s){var c=tr();if(typeof s=="function"){var d=s;if(s=d(),rl){Vn(!0);try{d()}finally{Vn(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:s},c}function kv(s,c,d,y){return s.baseState=d,rg(s,In,typeof y=="function"?y:_a)}function RA(s,c,d,y,k){if(qd(s))throw Error(i(485));if(s=c.action,s!==null){var T={payload:k,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){T.listeners.push(j)}};Z.T!==null?d(!0):T.isTransition=!1,y(T),d=c.pending,d===null?(T.next=c.pending=T,Av(c,T)):(T.next=d.next,c.pending=d.next=T)}}function Av(s,c){var d=c.action,y=c.payload,k=s.state;if(c.isTransition){var T=Z.T,j={};Z.T=j;try{var X=d(k,y),ae=Z.S;ae!==null&&ae(j,X),Tv(s,c,X)}catch(Ae){og(s,c,Ae)}finally{T!==null&&j.types!==null&&(T.types=j.types),Z.T=T}}else try{T=d(k,y),Tv(s,c,T)}catch(Ae){og(s,c,Ae)}}function Tv(s,c,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(y){Mv(s,c,y)},function(y){return og(s,c,y)}):Mv(s,c,d)}function Mv(s,c,d){c.status="fulfilled",c.value=d,Rv(c),s.state=d,c=s.pending,c!==null&&(d=c.next,d===c?s.pending=null:(d=d.next,c.next=d,Av(s,d)))}function og(s,c,d){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=d,Rv(c),c=c.next;while(c!==y)}s.action=null}function Rv(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function Ov(s,c){return c}function Nv(s,c){if(dn){var d=Fn.formState;if(d!==null){e:{var y=Xt;if(dn){if($n){t:{for(var k=$n,T=Gr;k.nodeType!==8;){if(!T){k=null;break t}if(k=Yr(k.nextSibling),k===null){k=null;break t}}T=k.data,k=T==="F!"||T==="F"?k:null}if(k){$n=Yr(k.nextSibling),y=k.data==="F!";break e}}io(y)}y=!1}y&&(c=d[0])}}return d=tr(),d.memoizedState=d.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ov,lastRenderedState:c},d.queue=y,d=Zv.bind(null,Xt,y),y.dispatch=d,y=ag(!1),T=fg.bind(null,Xt,!1,y.queue),y=tr(),k={state:c,dispatch:null,action:s,pending:null},y.queue=k,d=RA.bind(null,Xt,k,T,d),k.dispatch=d,y.memoizedState=s,[c,d,!1]}function Dv(s){var c=ci();return Iv(c,In,s)}function Iv(s,c,d){if(c=rg(s,c,Ov)[0],s=jd(_a)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=Uu(c)}catch(j){throw j===rc?Rd:j}else y=c;c=ci();var k=c.queue,T=k.dispatch;return d!==c.memoizedState&&(Xt.flags|=2048,cc(9,{destroy:void 0},OA.bind(null,k,d),null)),[y,T,s]}function OA(s,c){s.action=c}function Lv(s){var c=ci(),d=In;if(d!==null)return Iv(c,d,s);ci(),c=c.memoizedState,d=ci();var y=d.queue.dispatch;return d.memoizedState=s,[c,y,!1]}function cc(s,c,d,y){return s={tag:s,create:d,deps:y,inst:c,next:null},c=Xt.updateQueue,c===null&&(c=Pd(),Xt.updateQueue=c),d=c.lastEffect,d===null?c.lastEffect=s.next=s:(y=d.next,d.next=s,s.next=y,c.lastEffect=s),s}function Bv(){return ci().memoizedState}function Ud(s,c,d,y){var k=tr();Xt.flags|=s,k.memoizedState=cc(1|c,{destroy:void 0},d,y===void 0?null:y)}function Hd(s,c,d,y){var k=ci();y=y===void 0?null:y;var T=k.memoizedState.inst;In!==null&&y!==null&&Jm(y,In.memoizedState.deps)?k.memoizedState=cc(c,T,d,y):(Xt.flags|=s,k.memoizedState=cc(1|c,T,d,y))}function zv(s,c){Ud(8390656,8,s,c)}function lg(s,c){Hd(2048,8,s,c)}function NA(s){Xt.flags|=4;var c=Xt.updateQueue;if(c===null)c=Pd(),Xt.updateQueue=c,c.events=[s];else{var d=c.events;d===null?c.events=[s]:d.push(s)}}function Pv(s){var c=ci().memoizedState;return NA({ref:c,nextImpl:s}),function(){if((An&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function Fv(s,c){return Hd(4,2,s,c)}function jv(s,c){return Hd(4,4,s,c)}function Uv(s,c){if(typeof c=="function"){s=s();var d=c(s);return function(){typeof d=="function"?d():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function Hv(s,c,d){d=d!=null?d.concat([s]):null,Hd(4,4,Uv.bind(null,c,s),d)}function cg(){}function qv(s,c){var d=ci();c=c===void 0?null:c;var y=d.memoizedState;return c!==null&&Jm(c,y[1])?y[0]:(d.memoizedState=[s,c],s)}function Vv(s,c){var d=ci();c=c===void 0?null:c;var y=d.memoizedState;if(c!==null&&Jm(c,y[1]))return y[0];if(y=s(),rl){Vn(!0);try{s()}finally{Vn(!1)}}return d.memoizedState=[y,c],y}function ug(s,c,d){return d===void 0||(ya&1073741824)!==0&&(un&261930)===0?s.memoizedState=c:(s.memoizedState=d,s=W1(),Xt.lanes|=s,fo|=s,d)}function Wv(s,c,d,y){return qi(d,c)?d:ac.current!==null?(s=ug(s,d,y),qi(s,c)||(mi=!0),s):(ya&42)===0||(ya&1073741824)!==0&&(un&261930)===0?(mi=!0,s.memoizedState=d):(s=W1(),Xt.lanes|=s,fo|=s,c)}function $v(s,c,d,y,k){var T=ie.p;ie.p=T!==0&&8>T?T:8;var j=Z.T,X={};Z.T=X,fg(s,!1,c,d);try{var ae=k(),Ae=Z.S;if(Ae!==null&&Ae(X,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var Le=AA(ae,y);Hu(s,c,Le,kr(s))}else Hu(s,c,y,kr(s))}catch(je){Hu(s,c,{then:function(){},status:"rejected",reason:je},kr())}finally{ie.p=T,j!==null&&X.types!==null&&(j.types=X.types),Z.T=j}}function DA(){}function hg(s,c,d,y){if(s.tag!==5)throw Error(i(476));var k=Gv(s).queue;$v(s,k,c,ne,d===null?DA:function(){return Kv(s),d(y)})}function Gv(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:ne},next:null};var d={};return c.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:d},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function Kv(s){var c=Gv(s);c.next===null&&(c=s.alternate.memoizedState),Hu(s,c.next.queue,{},kr())}function dg(){return Bi(sh)}function Yv(){return ci().memoizedState}function Xv(){return ci().memoizedState}function IA(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var d=kr();s=ao(d);var y=oo(c,s,d);y!==null&&(mr(y,c,d),zu(y,c,d)),c={cache:Um()},s.payload=c;return}c=c.return}}function LA(s,c,d){var y=kr();d={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},qd(s)?Jv(c,d):(d=Vi(s,c,d,y),d!==null&&(mr(d,s,y),Qv(d,c,y)))}function Zv(s,c,d){var y=kr();Hu(s,c,d,y)}function Hu(s,c,d,y){var k={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(qd(s))Jv(c,k);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=c.lastRenderedReducer,T!==null))try{var j=c.lastRenderedState,X=T(j,d);if(k.hasEagerState=!0,k.eagerState=X,qi(X,j))return Dn(s,c,k,0),Fn===null&&Wt(),!1}catch{}if(d=Vi(s,c,k,y),d!==null)return mr(d,s,y),Qv(d,c,y),!0}return!1}function fg(s,c,d,y){if(y={lane:2,revertLane:Wg(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},qd(s)){if(c)throw Error(i(479))}else c=Vi(s,d,y,2),c!==null&&mr(c,s,2)}function qd(s){var c=s.alternate;return s===Xt||c!==null&&c===Xt}function Jv(s,c){oc=Bd=!0;var d=s.pending;d===null?c.next=c:(c.next=d.next,d.next=c),s.pending=c}function Qv(s,c,d){if((d&4194048)!==0){var y=c.lanes;y&=s.pendingLanes,d|=y,c.lanes=d,ut(s,d)}}var qu={readContext:Bi,use:Fd,useCallback:si,useContext:si,useEffect:si,useImperativeHandle:si,useLayoutEffect:si,useInsertionEffect:si,useMemo:si,useReducer:si,useRef:si,useState:si,useDebugValue:si,useDeferredValue:si,useTransition:si,useSyncExternalStore:si,useId:si,useHostTransitionStatus:si,useFormState:si,useActionState:si,useOptimistic:si,useMemoCache:si,useCacheRefresh:si};qu.useEffectEvent=si;var e1={readContext:Bi,use:Fd,useCallback:function(s,c){return tr().memoizedState=[s,c===void 0?null:c],s},useContext:Bi,useEffect:zv,useImperativeHandle:function(s,c,d){d=d!=null?d.concat([s]):null,Ud(4194308,4,Uv.bind(null,c,s),d)},useLayoutEffect:function(s,c){return Ud(4194308,4,s,c)},useInsertionEffect:function(s,c){Ud(4,2,s,c)},useMemo:function(s,c){var d=tr();c=c===void 0?null:c;var y=s();if(rl){Vn(!0);try{s()}finally{Vn(!1)}}return d.memoizedState=[y,c],y},useReducer:function(s,c,d){var y=tr();if(d!==void 0){var k=d(c);if(rl){Vn(!0);try{d(c)}finally{Vn(!1)}}}else k=c;return y.memoizedState=y.baseState=k,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:k},y.queue=s,s=s.dispatch=LA.bind(null,Xt,s),[y.memoizedState,s]},useRef:function(s){var c=tr();return s={current:s},c.memoizedState=s},useState:function(s){s=ag(s);var c=s.queue,d=Zv.bind(null,Xt,c);return c.dispatch=d,[s.memoizedState,d]},useDebugValue:cg,useDeferredValue:function(s,c){var d=tr();return ug(d,s,c)},useTransition:function(){var s=ag(!1);return s=$v.bind(null,Xt,s.queue,!0,!1),tr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,d){var y=Xt,k=tr();if(dn){if(d===void 0)throw Error(i(407));d=d()}else{if(d=c(),Fn===null)throw Error(i(349));(un&127)!==0||xv(y,c,d)}k.memoizedState=d;var T={value:d,getSnapshot:c};return k.queue=T,zv(wv.bind(null,y,T,s),[s]),y.flags|=2048,cc(9,{destroy:void 0},Sv.bind(null,y,T,d,c),null),d},useId:function(){var s=tr(),c=Fn.identifierPrefix;if(dn){var d=zs,y=Bs;d=(y&~(1<<32-et(y)-1)).toString(32)+d,c="_"+c+"R_"+d,d=zd++,0<d&&(c+="H"+d.toString(32)),c+="_"}else d=TA++,c="_"+c+"r_"+d.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:dg,useFormState:Nv,useActionState:Nv,useOptimistic:function(s){var c=tr();c.memoizedState=c.baseState=s;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=d,c=fg.bind(null,Xt,!0,d),d.dispatch=c,[s,c]},useMemoCache:ig,useCacheRefresh:function(){return tr().memoizedState=IA.bind(null,Xt)},useEffectEvent:function(s){var c=tr(),d={impl:s};return c.memoizedState=d,function(){if((An&2)!==0)throw Error(i(440));return d.impl.apply(void 0,arguments)}}},pg={readContext:Bi,use:Fd,useCallback:qv,useContext:Bi,useEffect:lg,useImperativeHandle:Hv,useInsertionEffect:Fv,useLayoutEffect:jv,useMemo:Vv,useReducer:jd,useRef:Bv,useState:function(){return jd(_a)},useDebugValue:cg,useDeferredValue:function(s,c){var d=ci();return Wv(d,In.memoizedState,s,c)},useTransition:function(){var s=jd(_a)[0],c=ci().memoizedState;return[typeof s=="boolean"?s:Uu(s),c]},useSyncExternalStore:vv,useId:Yv,useHostTransitionStatus:dg,useFormState:Dv,useActionState:Dv,useOptimistic:function(s,c){var d=ci();return kv(d,In,s,c)},useMemoCache:ig,useCacheRefresh:Xv};pg.useEffectEvent=Pv;var t1={readContext:Bi,use:Fd,useCallback:qv,useContext:Bi,useEffect:lg,useImperativeHandle:Hv,useInsertionEffect:Fv,useLayoutEffect:jv,useMemo:Vv,useReducer:sg,useRef:Bv,useState:function(){return sg(_a)},useDebugValue:cg,useDeferredValue:function(s,c){var d=ci();return In===null?ug(d,s,c):Wv(d,In.memoizedState,s,c)},useTransition:function(){var s=sg(_a)[0],c=ci().memoizedState;return[typeof s=="boolean"?s:Uu(s),c]},useSyncExternalStore:vv,useId:Yv,useHostTransitionStatus:dg,useFormState:Lv,useActionState:Lv,useOptimistic:function(s,c){var d=ci();return In!==null?kv(d,In,s,c):(d.baseState=s,[s,d.queue.dispatch])},useMemoCache:ig,useCacheRefresh:Xv};t1.useEffectEvent=Pv;function mg(s,c,d,y){c=s.memoizedState,d=d(y,c),d=d==null?c:f({},c,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var gg={enqueueSetState:function(s,c,d){s=s._reactInternals;var y=kr(),k=ao(y);k.payload=c,d!=null&&(k.callback=d),c=oo(s,k,y),c!==null&&(mr(c,s,y),zu(c,s,y))},enqueueReplaceState:function(s,c,d){s=s._reactInternals;var y=kr(),k=ao(y);k.tag=1,k.payload=c,d!=null&&(k.callback=d),c=oo(s,k,y),c!==null&&(mr(c,s,y),zu(c,s,y))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var d=kr(),y=ao(d);y.tag=2,c!=null&&(y.callback=c),c=oo(s,y,d),c!==null&&(mr(c,s,d),zu(c,s,d))}};function n1(s,c,d,y,k,T,j){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,T,j):c.prototype&&c.prototype.isPureReactComponent?!E(d,y)||!E(k,T):!0}function i1(s,c,d,y){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(d,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(d,y),c.state!==s&&gg.enqueueReplaceState(c,c.state,null)}function sl(s,c){var d=c;if("ref"in c){d={};for(var y in c)y!=="ref"&&(d[y]=c[y])}if(s=s.defaultProps){d===c&&(d=f({},d));for(var k in s)d[k]===void 0&&(d[k]=s[k])}return d}function r1(s){mt(s)}function s1(s){console.error(s)}function a1(s){mt(s)}function Vd(s,c){try{var d=s.onUncaughtError;d(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function o1(s,c,d){try{var y=s.onCaughtError;y(d.value,{componentStack:d.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function yg(s,c,d){return d=ao(d),d.tag=3,d.payload={element:null},d.callback=function(){Vd(s,c)},d}function l1(s){return s=ao(s),s.tag=3,s}function c1(s,c,d,y){var k=d.type.getDerivedStateFromError;if(typeof k=="function"){var T=y.value;s.payload=function(){return k(T)},s.callback=function(){o1(c,d,y)}}var j=d.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(s.callback=function(){o1(c,d,y),typeof k!="function"&&(po===null?po=new Set([this]):po.add(this));var X=y.stack;this.componentDidCatch(y.value,{componentStack:X!==null?X:""})})}function BA(s,c,d,y,k){if(d.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=d.alternate,c!==null&&tc(c,d,k,!0),d=Sr.current,d!==null){switch(d.tag){case 31:case 13:return Kr===null?nf():d.alternate===null&&ai===0&&(ai=3),d.flags&=-257,d.flags|=65536,d.lanes=k,y===Od?d.flags|=16384:(c=d.updateQueue,c===null?d.updateQueue=new Set([y]):c.add(y),Hg(s,y,k)),!1;case 22:return d.flags|=65536,y===Od?d.flags|=16384:(c=d.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},d.updateQueue=c):(d=c.retryQueue,d===null?c.retryQueue=new Set([y]):d.add(y)),Hg(s,y,k)),!1}throw Error(i(435,d.tag))}return Hg(s,y,k),nf(),!1}if(dn)return c=Sr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=k,y!==Bm&&(s=Error(i(422),{cause:y}),Nu(Vr(s,d)))):(y!==Bm&&(c=Error(i(423),{cause:y}),Nu(Vr(c,d))),s=s.current.alternate,s.flags|=65536,k&=-k,s.lanes|=k,y=Vr(y,d),k=yg(s.stateNode,y,k),Gm(s,k),ai!==4&&(ai=2)),!1;var T=Error(i(520),{cause:y});if(T=Vr(T,d),Zu===null?Zu=[T]:Zu.push(T),ai!==4&&(ai=2),c===null)return!0;y=Vr(y,d),d=c;do{switch(d.tag){case 3:return d.flags|=65536,s=k&-k,d.lanes|=s,s=yg(d.stateNode,y,s),Gm(d,s),!1;case 1:if(c=d.type,T=d.stateNode,(d.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(po===null||!po.has(T))))return d.flags|=65536,k&=-k,d.lanes|=k,k=l1(k),c1(k,s,d,y),Gm(d,k),!1}d=d.return}while(d!==null);return!1}var _g=Error(i(461)),mi=!1;function zi(s,c,d,y){c.child=s===null?fv(c,null,d,y):il(c,s.child,d,y)}function u1(s,c,d,y,k){d=d.render;var T=c.ref;if("ref"in y){var j={};for(var X in y)X!=="ref"&&(j[X]=y[X])}else j=y;return Qo(c),y=Qm(s,c,d,j,T,k),X=eg(),s!==null&&!mi?(tg(s,c,k),ba(s,c,k)):(dn&&X&&Im(c),c.flags|=1,zi(s,c,y,k),c.child)}function h1(s,c,d,y,k){if(s===null){var T=d.type;return typeof T=="function"&&!Om(T)&&T.defaultProps===void 0&&d.compare===null?(c.tag=15,c.type=T,d1(s,c,T,y,k)):(s=Ed(d.type,null,y,c,c.mode,k),s.ref=c.ref,s.return=c,c.child=s)}if(T=s.child,!kg(s,k)){var j=T.memoizedProps;if(d=d.compare,d=d!==null?d:E,d(j,y)&&s.ref===c.ref)return ba(s,c,k)}return c.flags|=1,s=fa(T,y),s.ref=c.ref,s.return=c,c.child=s}function d1(s,c,d,y,k){if(s!==null){var T=s.memoizedProps;if(E(T,y)&&s.ref===c.ref)if(mi=!1,c.pendingProps=y=T,kg(s,k))(s.flags&131072)!==0&&(mi=!0);else return c.lanes=s.lanes,ba(s,c,k)}return bg(s,c,d,y,k)}function f1(s,c,d,y){var k=y.children,T=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(T=T!==null?T.baseLanes|d:d,s!==null){for(y=c.child=s.child,k=0;y!==null;)k=k|y.lanes|y.childLanes,y=y.sibling;y=k&~T}else y=0,c.child=null;return p1(s,c,T,d,y)}if((d&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&Md(c,T!==null?T.cachePool:null),T!==null?gv(c,T):Ym(),yv(c);else return y=c.lanes=536870912,p1(s,c,T!==null?T.baseLanes|d:d,d,y)}else T!==null?(Md(c,T.cachePool),gv(c,T),co(),c.memoizedState=null):(s!==null&&Md(c,null),Ym(),co());return zi(s,c,k,d),c.child}function Vu(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function p1(s,c,d,y,k){var T=qm();return T=T===null?null:{parent:fi._currentValue,pool:T},c.memoizedState={baseLanes:d,cachePool:T},s!==null&&Md(c,null),Ym(),yv(c),s!==null&&tc(s,c,y,!0),c.childLanes=k,null}function Wd(s,c){return c=Gd({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function m1(s,c,d){return il(c,s.child,null,d),s=Wd(c,c.pendingProps),s.flags|=2,wr(c),c.memoizedState=null,s}function zA(s,c,d){var y=c.pendingProps,k=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(dn){if(y.mode==="hidden")return s=Wd(c,y),c.lanes=536870912,Vu(null,s);if(Zm(c),(s=$n)?(s=Ax(s,Gr),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:to!==null?{id:Bs,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},d=Jb(s),d.return=c,c.child=d,Li=c,$n=null)):s=null,s===null)throw io(c);return c.lanes=536870912,null}return Wd(c,y)}var T=s.memoizedState;if(T!==null){var j=T.dehydrated;if(Zm(c),k)if(c.flags&256)c.flags&=-257,c=m1(s,c,d);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(i(558));else if(mi||tc(s,c,d,!1),k=(d&s.childLanes)!==0,mi||k){if(y=Fn,y!==null&&(j=nn(y,d),j!==0&&j!==T.retryLane))throw T.retryLane=j,Rn(s,j),mr(y,s,j),_g;nf(),c=m1(s,c,d)}else s=T.treeContext,$n=Yr(j.nextSibling),Li=c,dn=!0,no=null,Gr=!1,s!==null&&tv(c,s),c=Wd(c,y),c.flags|=4096;return c}return s=fa(s.child,{mode:y.mode,children:y.children}),s.ref=c.ref,c.child=s,s.return=c,s}function $d(s,c){var d=c.ref;if(d===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(i(284));(s===null||s.ref!==d)&&(c.flags|=4194816)}}function bg(s,c,d,y,k){return Qo(c),d=Qm(s,c,d,y,void 0,k),y=eg(),s!==null&&!mi?(tg(s,c,k),ba(s,c,k)):(dn&&y&&Im(c),c.flags|=1,zi(s,c,d,k),c.child)}function g1(s,c,d,y,k,T){return Qo(c),c.updateQueue=null,d=bv(c,y,d,k),_v(s),y=eg(),s!==null&&!mi?(tg(s,c,T),ba(s,c,T)):(dn&&y&&Im(c),c.flags|=1,zi(s,c,d,T),c.child)}function y1(s,c,d,y,k){if(Qo(c),c.stateNode===null){var T=Zl,j=d.contextType;typeof j=="object"&&j!==null&&(T=Bi(j)),T=new d(y,T),c.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=gg,c.stateNode=T,T._reactInternals=c,T=c.stateNode,T.props=y,T.state=c.memoizedState,T.refs={},Wm(c),j=d.contextType,T.context=typeof j=="object"&&j!==null?Bi(j):Zl,T.state=c.memoizedState,j=d.getDerivedStateFromProps,typeof j=="function"&&(mg(c,d,j,y),T.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(j=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),j!==T.state&&gg.enqueueReplaceState(T,T.state,null),Fu(c,y,T,k),Pu(),T.state=c.memoizedState),typeof T.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(s===null){T=c.stateNode;var X=c.memoizedProps,ae=sl(d,X);T.props=ae;var Ae=T.context,Le=d.contextType;j=Zl,typeof Le=="object"&&Le!==null&&(j=Bi(Le));var je=d.getDerivedStateFromProps;Le=typeof je=="function"||typeof T.getSnapshotBeforeUpdate=="function",X=c.pendingProps!==X,Le||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(X||Ae!==j)&&i1(c,T,y,j),so=!1;var Me=c.memoizedState;T.state=Me,Fu(c,y,T,k),Pu(),Ae=c.memoizedState,X||Me!==Ae||so?(typeof je=="function"&&(mg(c,d,je,y),Ae=c.memoizedState),(ae=so||n1(c,d,ae,y,Me,Ae,j))?(Le||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(c.flags|=4194308)):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=Ae),T.props=y,T.state=Ae,T.context=j,y=ae):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{T=c.stateNode,$m(s,c),j=c.memoizedProps,Le=sl(d,j),T.props=Le,je=c.pendingProps,Me=T.context,Ae=d.contextType,ae=Zl,typeof Ae=="object"&&Ae!==null&&(ae=Bi(Ae)),X=d.getDerivedStateFromProps,(Ae=typeof X=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(j!==je||Me!==ae)&&i1(c,T,y,ae),so=!1,Me=c.memoizedState,T.state=Me,Fu(c,y,T,k),Pu();var Oe=c.memoizedState;j!==je||Me!==Oe||so||s!==null&&s.dependencies!==null&&Ad(s.dependencies)?(typeof X=="function"&&(mg(c,d,X,y),Oe=c.memoizedState),(Le=so||n1(c,d,Le,y,Me,Oe,ae)||s!==null&&s.dependencies!==null&&Ad(s.dependencies))?(Ae||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(y,Oe,ae),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(y,Oe,ae)),typeof T.componentDidUpdate=="function"&&(c.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof T.componentDidUpdate!="function"||j===s.memoizedProps&&Me===s.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&Me===s.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Oe),T.props=y,T.state=Oe,T.context=ae,y=Le):(typeof T.componentDidUpdate!="function"||j===s.memoizedProps&&Me===s.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&Me===s.memoizedState||(c.flags|=1024),y=!1)}return T=y,$d(s,c),y=(c.flags&128)!==0,T||y?(T=c.stateNode,d=y&&typeof d.getDerivedStateFromError!="function"?null:T.render(),c.flags|=1,s!==null&&y?(c.child=il(c,s.child,null,k),c.child=il(c,null,d,k)):zi(s,c,d,k),c.memoizedState=T.state,s=c.child):s=ba(s,c,k),s}function _1(s,c,d,y){return Zo(),c.flags|=256,zi(s,c,d,y),c.child}var vg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xg(s){return{baseLanes:s,cachePool:ov()}}function Sg(s,c,d){return s=s!==null?s.childLanes&~d:0,c&&(s|=Er),s}function b1(s,c,d){var y=c.pendingProps,k=!1,T=(c.flags&128)!==0,j;if((j=T)||(j=s!==null&&s.memoizedState===null?!1:(li.current&2)!==0),j&&(k=!0,c.flags&=-129),j=(c.flags&32)!==0,c.flags&=-33,s===null){if(dn){if(k?lo(c):co(),(s=$n)?(s=Ax(s,Gr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:to!==null?{id:Bs,overflow:zs}:null,retryLane:536870912,hydrationErrors:null},d=Jb(s),d.return=c,c.child=d,Li=c,$n=null)):s=null,s===null)throw io(c);return ry(s)?c.lanes=32:c.lanes=536870912,null}var X=y.children;return y=y.fallback,k?(co(),k=c.mode,X=Gd({mode:"hidden",children:X},k),y=Xo(y,k,d,null),X.return=c,y.return=c,X.sibling=y,c.child=X,y=c.child,y.memoizedState=xg(d),y.childLanes=Sg(s,j,d),c.memoizedState=vg,Vu(null,y)):(lo(c),wg(c,X))}var ae=s.memoizedState;if(ae!==null&&(X=ae.dehydrated,X!==null)){if(T)c.flags&256?(lo(c),c.flags&=-257,c=Cg(s,c,d)):c.memoizedState!==null?(co(),c.child=s.child,c.flags|=128,c=null):(co(),X=y.fallback,k=c.mode,y=Gd({mode:"visible",children:y.children},k),X=Xo(X,k,d,null),X.flags|=2,y.return=c,X.return=c,y.sibling=X,c.child=y,il(c,s.child,null,d),y=c.child,y.memoizedState=xg(d),y.childLanes=Sg(s,j,d),c.memoizedState=vg,c=Vu(null,y));else if(lo(c),ry(X)){if(j=X.nextSibling&&X.nextSibling.dataset,j)var Ae=j.dgst;j=Ae,y=Error(i(419)),y.stack="",y.digest=j,Nu({value:y,source:null,stack:null}),c=Cg(s,c,d)}else if(mi||tc(s,c,d,!1),j=(d&s.childLanes)!==0,mi||j){if(j=Fn,j!==null&&(y=nn(j,d),y!==0&&y!==ae.retryLane))throw ae.retryLane=y,Rn(s,y),mr(j,s,y),_g;iy(X)||nf(),c=Cg(s,c,d)}else iy(X)?(c.flags|=192,c.child=s.child,c=null):(s=ae.treeContext,$n=Yr(X.nextSibling),Li=c,dn=!0,no=null,Gr=!1,s!==null&&tv(c,s),c=wg(c,y.children),c.flags|=4096);return c}return k?(co(),X=y.fallback,k=c.mode,ae=s.child,Ae=ae.sibling,y=fa(ae,{mode:"hidden",children:y.children}),y.subtreeFlags=ae.subtreeFlags&65011712,Ae!==null?X=fa(Ae,X):(X=Xo(X,k,d,null),X.flags|=2),X.return=c,y.return=c,y.sibling=X,c.child=y,Vu(null,y),y=c.child,X=s.child.memoizedState,X===null?X=xg(d):(k=X.cachePool,k!==null?(ae=fi._currentValue,k=k.parent!==ae?{parent:ae,pool:ae}:k):k=ov(),X={baseLanes:X.baseLanes|d,cachePool:k}),y.memoizedState=X,y.childLanes=Sg(s,j,d),c.memoizedState=vg,Vu(s.child,y)):(lo(c),d=s.child,s=d.sibling,d=fa(d,{mode:"visible",children:y.children}),d.return=c,d.sibling=null,s!==null&&(j=c.deletions,j===null?(c.deletions=[s],c.flags|=16):j.push(s)),c.child=d,c.memoizedState=null,d)}function wg(s,c){return c=Gd({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Gd(s,c){return s=xr(22,s,null,c),s.lanes=0,s}function Cg(s,c,d){return il(c,s.child,null,d),s=wg(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function v1(s,c,d){s.lanes|=c;var y=s.alternate;y!==null&&(y.lanes|=c),Fm(s.return,c,d)}function Eg(s,c,d,y,k,T){var j=s.memoizedState;j===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:k,treeForkCount:T}:(j.isBackwards=c,j.rendering=null,j.renderingStartTime=0,j.last=y,j.tail=d,j.tailMode=k,j.treeForkCount=T)}function x1(s,c,d){var y=c.pendingProps,k=y.revealOrder,T=y.tail;y=y.children;var j=li.current,X=(j&2)!==0;if(X?(j=j&1|2,c.flags|=128):j&=1,W(li,j),zi(s,c,y,d),y=dn?Ou:0,!X&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&v1(s,d,c);else if(s.tag===19)v1(s,d,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(k){case"forwards":for(d=c.child,k=null;d!==null;)s=d.alternate,s!==null&&Ld(s)===null&&(k=d),d=d.sibling;d=k,d===null?(k=c.child,c.child=null):(k=d.sibling,d.sibling=null),Eg(c,!1,k,d,T,y);break;case"backwards":case"unstable_legacy-backwards":for(d=null,k=c.child,c.child=null;k!==null;){if(s=k.alternate,s!==null&&Ld(s)===null){c.child=k;break}s=k.sibling,k.sibling=d,d=k,k=s}Eg(c,!0,d,null,T,y);break;case"together":Eg(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function ba(s,c,d){if(s!==null&&(c.dependencies=s.dependencies),fo|=c.lanes,(d&c.childLanes)===0)if(s!==null){if(tc(s,c,d,!1),(d&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(i(153));if(c.child!==null){for(s=c.child,d=fa(s,s.pendingProps),c.child=d,d.return=c;s.sibling!==null;)s=s.sibling,d=d.sibling=fa(s,s.pendingProps),d.return=c;d.sibling=null}return c.child}function kg(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&Ad(s)))}function PA(s,c,d){switch(c.tag){case 3:ee(c,c.stateNode.containerInfo),ro(c,fi,s.memoizedState.cache),Zo();break;case 27:case 5:xe(c);break;case 4:ee(c,c.stateNode.containerInfo);break;case 10:ro(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Zm(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(lo(c),c.flags|=128,null):(d&c.child.childLanes)!==0?b1(s,c,d):(lo(c),s=ba(s,c,d),s!==null?s.sibling:null);lo(c);break;case 19:var k=(s.flags&128)!==0;if(y=(d&c.childLanes)!==0,y||(tc(s,c,d,!1),y=(d&c.childLanes)!==0),k){if(y)return x1(s,c,d);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),W(li,li.current),y)break;return null;case 22:return c.lanes=0,f1(s,c,d,c.pendingProps);case 24:ro(c,fi,s.memoizedState.cache)}return ba(s,c,d)}function S1(s,c,d){if(s!==null)if(s.memoizedProps!==c.pendingProps)mi=!0;else{if(!kg(s,d)&&(c.flags&128)===0)return mi=!1,PA(s,c,d);mi=(s.flags&131072)!==0}else mi=!1,dn&&(c.flags&1048576)!==0&&ev(c,Ou,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(s=tl(c.elementType),c.type=s,typeof s=="function")Om(s)?(y=sl(s,y),c.tag=1,c=y1(null,c,s,y,d)):(c.tag=0,c=bg(null,c,s,y,d));else{if(s!=null){var k=s.$$typeof;if(k===C){c.tag=11,c=u1(null,c,s,y,d);break e}else if(k===D){c.tag=14,c=h1(null,c,s,y,d);break e}}throw c=J(s)||s,Error(i(306,c,""))}}return c;case 0:return bg(s,c,c.type,c.pendingProps,d);case 1:return y=c.type,k=sl(y,c.pendingProps),y1(s,c,y,k,d);case 3:e:{if(ee(c,c.stateNode.containerInfo),s===null)throw Error(i(387));y=c.pendingProps;var T=c.memoizedState;k=T.element,$m(s,c),Fu(c,y,null,d);var j=c.memoizedState;if(y=j.cache,ro(c,fi,y),y!==T.cache&&jm(c,[fi],d,!0),Pu(),y=j.element,T.isDehydrated)if(T={element:y,isDehydrated:!1,cache:j.cache},c.updateQueue.baseState=T,c.memoizedState=T,c.flags&256){c=_1(s,c,y,d);break e}else if(y!==k){k=Vr(Error(i(424)),c),Nu(k),c=_1(s,c,y,d);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,$n=Yr(s.firstChild),Li=c,dn=!0,no=null,Gr=!0,d=fv(c,null,y,d),c.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Zo(),y===k){c=ba(s,c,d);break e}zi(s,c,y,d)}c=c.child}return c;case 26:return $d(s,c),s===null?(d=Dx(c.type,null,c.pendingProps,null))?c.memoizedState=d:dn||(d=c.type,s=c.pendingProps,y=uf(Ne.current).createElement(d),y[Mn]=c,y[Qn]=s,Pi(y,d,s),ei(y),c.stateNode=y):c.memoizedState=Dx(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return xe(c),s===null&&dn&&(y=c.stateNode=Rx(c.type,c.pendingProps,Ne.current),Li=c,Gr=!0,k=$n,_o(c.type)?(sy=k,$n=Yr(y.firstChild)):$n=k),zi(s,c,c.pendingProps.children,d),$d(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&dn&&((k=y=$n)&&(y=pT(y,c.type,c.pendingProps,Gr),y!==null?(c.stateNode=y,Li=c,$n=Yr(y.firstChild),Gr=!1,k=!0):k=!1),k||io(c)),xe(c),k=c.type,T=c.pendingProps,j=s!==null?s.memoizedProps:null,y=T.children,ey(k,T)?y=null:j!==null&&ey(k,j)&&(c.flags|=32),c.memoizedState!==null&&(k=Qm(s,c,MA,null,null,d),sh._currentValue=k),$d(s,c),zi(s,c,y,d),c.child;case 6:return s===null&&dn&&((s=d=$n)&&(d=mT(d,c.pendingProps,Gr),d!==null?(c.stateNode=d,Li=c,$n=null,s=!0):s=!1),s||io(c)),null;case 13:return b1(s,c,d);case 4:return ee(c,c.stateNode.containerInfo),y=c.pendingProps,s===null?c.child=il(c,null,y,d):zi(s,c,y,d),c.child;case 11:return u1(s,c,c.type,c.pendingProps,d);case 7:return zi(s,c,c.pendingProps,d),c.child;case 8:return zi(s,c,c.pendingProps.children,d),c.child;case 12:return zi(s,c,c.pendingProps.children,d),c.child;case 10:return y=c.pendingProps,ro(c,c.type,y.value),zi(s,c,y.children,d),c.child;case 9:return k=c.type._context,y=c.pendingProps.children,Qo(c),k=Bi(k),y=y(k),c.flags|=1,zi(s,c,y,d),c.child;case 14:return h1(s,c,c.type,c.pendingProps,d);case 15:return d1(s,c,c.type,c.pendingProps,d);case 19:return x1(s,c,d);case 31:return zA(s,c,d);case 22:return f1(s,c,d,c.pendingProps);case 24:return Qo(c),y=Bi(fi),s===null?(k=qm(),k===null&&(k=Fn,T=Um(),k.pooledCache=T,T.refCount++,T!==null&&(k.pooledCacheLanes|=d),k=T),c.memoizedState={parent:y,cache:k},Wm(c),ro(c,fi,k)):((s.lanes&d)!==0&&($m(s,c),Fu(c,null,null,d),Pu()),k=s.memoizedState,T=c.memoizedState,k.parent!==y?(k={parent:y,cache:y},c.memoizedState=k,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=k),ro(c,fi,y)):(y=T.cache,ro(c,fi,y),y!==k.cache&&jm(c,[fi],d,!0))),zi(s,c,c.pendingProps.children,d),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function va(s){s.flags|=4}function Ag(s,c,d,y,k){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(k&335544128)===k)if(s.stateNode.complete)s.flags|=8192;else if(Y1())s.flags|=8192;else throw nl=Od,Vm}else s.flags&=-16777217}function w1(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Px(c))if(Y1())s.flags|=8192;else throw nl=Od,Vm}function Kd(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?Ft():536870912,s.lanes|=c,fc|=c)}function Wu(s,c){if(!dn)switch(s.tailMode){case"hidden":c=s.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function Gn(s){var c=s.alternate!==null&&s.alternate.child===s.child,d=0,y=0;if(c)for(var k=s.child;k!==null;)d|=k.lanes|k.childLanes,y|=k.subtreeFlags&65011712,y|=k.flags&65011712,k.return=s,k=k.sibling;else for(k=s.child;k!==null;)d|=k.lanes|k.childLanes,y|=k.subtreeFlags,y|=k.flags,k.return=s,k=k.sibling;return s.subtreeFlags|=y,s.childLanes=d,c}function FA(s,c,d){var y=c.pendingProps;switch(Lm(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gn(c),null;case 1:return Gn(c),null;case 3:return d=c.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),ga(fi),Ce(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(s===null||s.child===null)&&(ec(c)?va(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,zm())),Gn(c),null;case 26:var k=c.type,T=c.memoizedState;return s===null?(va(c),T!==null?(Gn(c),w1(c,T)):(Gn(c),Ag(c,k,null,y,d))):T?T!==s.memoizedState?(va(c),Gn(c),w1(c,T)):(Gn(c),c.flags&=-16777217):(s=s.memoizedProps,s!==y&&va(c),Gn(c),Ag(c,k,s,y,d)),null;case 27:if(Ze(c),d=Ne.current,k=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&va(c);else{if(!y){if(c.stateNode===null)throw Error(i(166));return Gn(c),null}s=ye.current,ec(c)?nv(c):(s=Rx(k,y,d),c.stateNode=s,va(c))}return Gn(c),null;case 5:if(Ze(c),k=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&va(c);else{if(!y){if(c.stateNode===null)throw Error(i(166));return Gn(c),null}if(T=ye.current,ec(c))nv(c);else{var j=uf(Ne.current);switch(T){case 1:T=j.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:T=j.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":T=j.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":T=j.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":T=j.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof y.is=="string"?j.createElement("select",{is:y.is}):j.createElement("select"),y.multiple?T.multiple=!0:y.size&&(T.size=y.size);break;default:T=typeof y.is=="string"?j.createElement(k,{is:y.is}):j.createElement(k)}}T[Mn]=c,T[Qn]=y;e:for(j=c.child;j!==null;){if(j.tag===5||j.tag===6)T.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===c)break e;for(;j.sibling===null;){if(j.return===null||j.return===c)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}c.stateNode=T;e:switch(Pi(T,k,y),k){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&va(c)}}return Gn(c),Ag(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,d),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==y&&va(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(i(166));if(s=Ne.current,ec(c)){if(s=c.stateNode,d=c.memoizedProps,y=null,k=Li,k!==null)switch(k.tag){case 27:case 5:y=k.memoizedProps}s[Mn]=c,s=!!(s.nodeValue===d||y!==null&&y.suppressHydrationWarning===!0||bx(s.nodeValue,d)),s||io(c,!0)}else s=uf(s).createTextNode(y),s[Mn]=c,c.stateNode=s}return Gn(c),null;case 31:if(d=c.memoizedState,s===null||s.memoizedState!==null){if(y=ec(c),d!==null){if(s===null){if(!y)throw Error(i(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Mn]=c}else Zo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Gn(c),s=!1}else d=zm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=d),s=!0;if(!s)return c.flags&256?(wr(c),c):(wr(c),null);if((c.flags&128)!==0)throw Error(i(558))}return Gn(c),null;case 13:if(y=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(k=ec(c),y!==null&&y.dehydrated!==null){if(s===null){if(!k)throw Error(i(318));if(k=c.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(i(317));k[Mn]=c}else Zo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Gn(c),k=!1}else k=zm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=k),k=!0;if(!k)return c.flags&256?(wr(c),c):(wr(c),null)}return wr(c),(c.flags&128)!==0?(c.lanes=d,c):(d=y!==null,s=s!==null&&s.memoizedState!==null,d&&(y=c.child,k=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(k=y.alternate.memoizedState.cachePool.pool),T=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(T=y.memoizedState.cachePool.pool),T!==k&&(y.flags|=2048)),d!==s&&d&&(c.child.flags|=8192),Kd(c,c.updateQueue),Gn(c),null);case 4:return Ce(),s===null&&Yg(c.stateNode.containerInfo),Gn(c),null;case 10:return ga(c.type),Gn(c),null;case 19:if($(li),y=c.memoizedState,y===null)return Gn(c),null;if(k=(c.flags&128)!==0,T=y.rendering,T===null)if(k)Wu(y,!1);else{if(ai!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(T=Ld(s),T!==null){for(c.flags|=128,Wu(y,!1),s=T.updateQueue,c.updateQueue=s,Kd(c,s),c.subtreeFlags=0,s=d,d=c.child;d!==null;)Zb(d,s),d=d.sibling;return W(li,li.current&1|2),dn&&pa(c,y.treeForkCount),c.child}s=s.sibling}y.tail!==null&&st()>Qd&&(c.flags|=128,k=!0,Wu(y,!1),c.lanes=4194304)}else{if(!k)if(s=Ld(T),s!==null){if(c.flags|=128,k=!0,s=s.updateQueue,c.updateQueue=s,Kd(c,s),Wu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!T.alternate&&!dn)return Gn(c),null}else 2*st()-y.renderingStartTime>Qd&&d!==536870912&&(c.flags|=128,k=!0,Wu(y,!1),c.lanes=4194304);y.isBackwards?(T.sibling=c.child,c.child=T):(s=y.last,s!==null?s.sibling=T:c.child=T,y.last=T)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=st(),s.sibling=null,d=li.current,W(li,k?d&1|2:d&1),dn&&pa(c,y.treeForkCount),s):(Gn(c),null);case 22:case 23:return wr(c),Xm(),y=c.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(d&536870912)!==0&&(c.flags&128)===0&&(Gn(c),c.subtreeFlags&6&&(c.flags|=8192)):Gn(c),d=c.updateQueue,d!==null&&Kd(c,d.retryQueue),d=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==d&&(c.flags|=2048),s!==null&&$(el),null;case 24:return d=null,s!==null&&(d=s.memoizedState.cache),c.memoizedState.cache!==d&&(c.flags|=2048),ga(fi),Gn(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function jA(s,c){switch(Lm(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return ga(fi),Ce(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Ze(c),null;case 31:if(c.memoizedState!==null){if(wr(c),c.alternate===null)throw Error(i(340));Zo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(wr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Zo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return $(li),null;case 4:return Ce(),null;case 10:return ga(c.type),null;case 22:case 23:return wr(c),Xm(),s!==null&&$(el),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return ga(fi),null;case 25:return null;default:return null}}function C1(s,c){switch(Lm(c),c.tag){case 3:ga(fi),Ce();break;case 26:case 27:case 5:Ze(c);break;case 4:Ce();break;case 31:c.memoizedState!==null&&wr(c);break;case 13:wr(c);break;case 19:$(li);break;case 10:ga(c.type);break;case 22:case 23:wr(c),Xm(),s!==null&&$(el);break;case 24:ga(fi)}}function $u(s,c){try{var d=c.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var k=y.next;d=k;do{if((d.tag&s)===s){y=void 0;var T=d.create,j=d.inst;y=T(),j.destroy=y}d=d.next}while(d!==k)}}catch(X){Nn(c,c.return,X)}}function uo(s,c,d){try{var y=c.updateQueue,k=y!==null?y.lastEffect:null;if(k!==null){var T=k.next;y=T;do{if((y.tag&s)===s){var j=y.inst,X=j.destroy;if(X!==void 0){j.destroy=void 0,k=c;var ae=d,Ae=X;try{Ae()}catch(Le){Nn(k,ae,Le)}}}y=y.next}while(y!==T)}}catch(Le){Nn(c,c.return,Le)}}function E1(s){var c=s.updateQueue;if(c!==null){var d=s.stateNode;try{mv(c,d)}catch(y){Nn(s,s.return,y)}}}function k1(s,c,d){d.props=sl(s.type,s.memoizedProps),d.state=s.memoizedState;try{d.componentWillUnmount()}catch(y){Nn(s,c,y)}}function Gu(s,c){try{var d=s.ref;if(d!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof d=="function"?s.refCleanup=d(y):d.current=y}}catch(k){Nn(s,c,k)}}function Ps(s,c){var d=s.ref,y=s.refCleanup;if(d!==null)if(typeof y=="function")try{y()}catch(k){Nn(s,c,k)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(k){Nn(s,c,k)}else d.current=null}function A1(s){var c=s.type,d=s.memoizedProps,y=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":d.autoFocus&&y.focus();break e;case"img":d.src?y.src=d.src:d.srcSet&&(y.srcset=d.srcSet)}}catch(k){Nn(s,s.return,k)}}function Tg(s,c,d){try{var y=s.stateNode;lT(y,s.type,d,c),y[Qn]=c}catch(k){Nn(s,s.return,k)}}function T1(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&_o(s.type)||s.tag===4}function Mg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||T1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&_o(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Rg(s,c,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(s,c):(c=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,c.appendChild(s),d=d._reactRootContainer,d!=null||c.onclick!==null||(c.onclick=tt));else if(y!==4&&(y===27&&_o(s.type)&&(d=s.stateNode,c=null),s=s.child,s!==null))for(Rg(s,c,d),s=s.sibling;s!==null;)Rg(s,c,d),s=s.sibling}function Yd(s,c,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?d.insertBefore(s,c):d.appendChild(s);else if(y!==4&&(y===27&&_o(s.type)&&(d=s.stateNode),s=s.child,s!==null))for(Yd(s,c,d),s=s.sibling;s!==null;)Yd(s,c,d),s=s.sibling}function M1(s){var c=s.stateNode,d=s.memoizedProps;try{for(var y=s.type,k=c.attributes;k.length;)c.removeAttributeNode(k[0]);Pi(c,y,d),c[Mn]=s,c[Qn]=d}catch(T){Nn(s,s.return,T)}}var xa=!1,gi=!1,Og=!1,R1=typeof WeakSet=="function"?WeakSet:Set,Ri=null;function UA(s,c){if(s=s.containerInfo,Jg=yf,s=q(s),G(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var y=d.getSelection&&d.getSelection();if(y&&y.rangeCount!==0){d=y.anchorNode;var k=y.anchorOffset,T=y.focusNode;y=y.focusOffset;try{d.nodeType,T.nodeType}catch{d=null;break e}var j=0,X=-1,ae=-1,Ae=0,Le=0,je=s,Me=null;t:for(;;){for(var Oe;je!==d||k!==0&&je.nodeType!==3||(X=j+k),je!==T||y!==0&&je.nodeType!==3||(ae=j+y),je.nodeType===3&&(j+=je.nodeValue.length),(Oe=je.firstChild)!==null;)Me=je,je=Oe;for(;;){if(je===s)break t;if(Me===d&&++Ae===k&&(X=j),Me===T&&++Le===y&&(ae=j),(Oe=je.nextSibling)!==null)break;je=Me,Me=je.parentNode}je=Oe}d=X===-1||ae===-1?null:{start:X,end:ae}}else d=null}d=d||{start:0,end:0}}else d=null;for(Qg={focusedElem:s,selectionRange:d},yf=!1,Ri=c;Ri!==null;)if(c=Ri,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Ri=s;else for(;Ri!==null;){switch(c=Ri,T=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(d=0;d<s.length;d++)k=s[d],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,d=c,k=T.memoizedProps,T=T.memoizedState,y=d.stateNode;try{var bt=sl(d.type,k);s=y.getSnapshotBeforeUpdate(bt,T),y.__reactInternalSnapshotBeforeUpdate=s}catch(Bt){Nn(d,d.return,Bt)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,d=s.nodeType,d===9)ny(s);else if(d===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ny(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=c.sibling,s!==null){s.return=c.return,Ri=s;break}Ri=c.return}}function O1(s,c,d){var y=d.flags;switch(d.tag){case 0:case 11:case 15:wa(s,d),y&4&&$u(5,d);break;case 1:if(wa(s,d),y&4)if(s=d.stateNode,c===null)try{s.componentDidMount()}catch(j){Nn(d,d.return,j)}else{var k=sl(d.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(k,c,s.__reactInternalSnapshotBeforeUpdate)}catch(j){Nn(d,d.return,j)}}y&64&&E1(d),y&512&&Gu(d,d.return);break;case 3:if(wa(s,d),y&64&&(s=d.updateQueue,s!==null)){if(c=null,d.child!==null)switch(d.child.tag){case 27:case 5:c=d.child.stateNode;break;case 1:c=d.child.stateNode}try{mv(s,c)}catch(j){Nn(d,d.return,j)}}break;case 27:c===null&&y&4&&M1(d);case 26:case 5:wa(s,d),c===null&&y&4&&A1(d),y&512&&Gu(d,d.return);break;case 12:wa(s,d);break;case 31:wa(s,d),y&4&&I1(s,d);break;case 13:wa(s,d),y&4&&L1(s,d),y&64&&(s=d.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(d=XA.bind(null,d),gT(s,d))));break;case 22:if(y=d.memoizedState!==null||xa,!y){c=c!==null&&c.memoizedState!==null||gi,k=xa;var T=gi;xa=y,(gi=c)&&!T?Ca(s,d,(d.subtreeFlags&8772)!==0):wa(s,d),xa=k,gi=T}break;case 30:break;default:wa(s,d)}}function N1(s){var c=s.alternate;c!==null&&(s.alternate=null,N1(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Va(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Xn=null,hr=!1;function Sa(s,c,d){for(d=d.child;d!==null;)D1(s,c,d),d=d.sibling}function D1(s,c,d){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(Pn,d)}catch{}switch(d.tag){case 26:gi||Ps(d,c),Sa(s,c,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:gi||Ps(d,c);var y=Xn,k=hr;_o(d.type)&&(Xn=d.stateNode,hr=!1),Sa(s,c,d),nh(d.stateNode),Xn=y,hr=k;break;case 5:gi||Ps(d,c);case 6:if(y=Xn,k=hr,Xn=null,Sa(s,c,d),Xn=y,hr=k,Xn!==null)if(hr)try{(Xn.nodeType===9?Xn.body:Xn.nodeName==="HTML"?Xn.ownerDocument.body:Xn).removeChild(d.stateNode)}catch(T){Nn(d,c,T)}else try{Xn.removeChild(d.stateNode)}catch(T){Nn(d,c,T)}break;case 18:Xn!==null&&(hr?(s=Xn,Ex(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,d.stateNode),xc(s)):Ex(Xn,d.stateNode));break;case 4:y=Xn,k=hr,Xn=d.stateNode.containerInfo,hr=!0,Sa(s,c,d),Xn=y,hr=k;break;case 0:case 11:case 14:case 15:uo(2,d,c),gi||uo(4,d,c),Sa(s,c,d);break;case 1:gi||(Ps(d,c),y=d.stateNode,typeof y.componentWillUnmount=="function"&&k1(d,c,y)),Sa(s,c,d);break;case 21:Sa(s,c,d);break;case 22:gi=(y=gi)||d.memoizedState!==null,Sa(s,c,d),gi=y;break;default:Sa(s,c,d)}}function I1(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{xc(s)}catch(d){Nn(c,c.return,d)}}}function L1(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{xc(s)}catch(d){Nn(c,c.return,d)}}function HA(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new R1),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new R1),c;default:throw Error(i(435,s.tag))}}function Xd(s,c){var d=HA(s);c.forEach(function(y){if(!d.has(y)){d.add(y);var k=ZA.bind(null,s,y);y.then(k,k)}})}function dr(s,c){var d=c.deletions;if(d!==null)for(var y=0;y<d.length;y++){var k=d[y],T=s,j=c,X=j;e:for(;X!==null;){switch(X.tag){case 27:if(_o(X.type)){Xn=X.stateNode,hr=!1;break e}break;case 5:Xn=X.stateNode,hr=!1;break e;case 3:case 4:Xn=X.stateNode.containerInfo,hr=!0;break e}X=X.return}if(Xn===null)throw Error(i(160));D1(T,j,k),Xn=null,hr=!1,T=k.alternate,T!==null&&(T.return=null),k.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)B1(c,s),c=c.sibling}var hs=null;function B1(s,c){var d=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:dr(c,s),fr(s),y&4&&(uo(3,s,s.return),$u(3,s),uo(5,s,s.return));break;case 1:dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),y&64&&xa&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(d=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=d===null?y:d.concat(y))));break;case 26:var k=hs;if(dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),y&4){var T=d!==null?d.memoizedState:null;if(y=s.memoizedState,d===null)if(y===null)if(s.stateNode===null){e:{y=s.type,d=s.memoizedProps,k=k.ownerDocument||k;t:switch(y){case"title":T=k.getElementsByTagName("title")[0],(!T||T[Qi]||T[Mn]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=k.createElement(y),k.head.insertBefore(T,k.querySelector("head > title"))),Pi(T,y,d),T[Mn]=s,ei(T),y=T;break e;case"link":var j=Bx("link","href",k).get(y+(d.href||""));if(j){for(var X=0;X<j.length;X++)if(T=j[X],T.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&T.getAttribute("rel")===(d.rel==null?null:d.rel)&&T.getAttribute("title")===(d.title==null?null:d.title)&&T.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){j.splice(X,1);break t}}T=k.createElement(y),Pi(T,y,d),k.head.appendChild(T);break;case"meta":if(j=Bx("meta","content",k).get(y+(d.content||""))){for(X=0;X<j.length;X++)if(T=j[X],T.getAttribute("content")===(d.content==null?null:""+d.content)&&T.getAttribute("name")===(d.name==null?null:d.name)&&T.getAttribute("property")===(d.property==null?null:d.property)&&T.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&T.getAttribute("charset")===(d.charSet==null?null:d.charSet)){j.splice(X,1);break t}}T=k.createElement(y),Pi(T,y,d),k.head.appendChild(T);break;default:throw Error(i(468,y))}T[Mn]=s,ei(T),y=T}s.stateNode=y}else zx(k,s.type,s.stateNode);else s.stateNode=Lx(k,y,s.memoizedProps);else T!==y?(T===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):T.count--,y===null?zx(k,s.type,s.stateNode):Lx(k,y,s.memoizedProps)):y===null&&s.stateNode!==null&&Tg(s,s.memoizedProps,d.memoizedProps)}break;case 27:dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),d!==null&&y&4&&Tg(s,s.memoizedProps,d.memoizedProps);break;case 5:if(dr(c,s),fr(s),y&512&&(gi||d===null||Ps(d,d.return)),s.flags&32){k=s.stateNode;try{Rt(k,"")}catch(bt){Nn(s,s.return,bt)}}y&4&&s.stateNode!=null&&(k=s.memoizedProps,Tg(s,k,d!==null?d.memoizedProps:k)),y&1024&&(Og=!0);break;case 6:if(dr(c,s),fr(s),y&4){if(s.stateNode===null)throw Error(i(162));y=s.memoizedProps,d=s.stateNode;try{d.nodeValue=y}catch(bt){Nn(s,s.return,bt)}}break;case 3:if(ff=null,k=hs,hs=hf(c.containerInfo),dr(c,s),hs=k,fr(s),y&4&&d!==null&&d.memoizedState.isDehydrated)try{xc(c.containerInfo)}catch(bt){Nn(s,s.return,bt)}Og&&(Og=!1,z1(s));break;case 4:y=hs,hs=hf(s.stateNode.containerInfo),dr(c,s),fr(s),hs=y;break;case 12:dr(c,s),fr(s);break;case 31:dr(c,s),fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 13:dr(c,s),fr(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Jd=st()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 22:k=s.memoizedState!==null;var ae=d!==null&&d.memoizedState!==null,Ae=xa,Le=gi;if(xa=Ae||k,gi=Le||ae,dr(c,s),gi=Le,xa=Ae,fr(s),y&8192)e:for(c=s.stateNode,c._visibility=k?c._visibility&-2:c._visibility|1,k&&(d===null||ae||xa||gi||al(s)),d=null,c=s;;){if(c.tag===5||c.tag===26){if(d===null){ae=d=c;try{if(T=ae.stateNode,k)j=T.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{X=ae.stateNode;var je=ae.memoizedProps.style,Me=je!=null&&je.hasOwnProperty("display")?je.display:null;X.style.display=Me==null||typeof Me=="boolean"?"":(""+Me).trim()}}catch(bt){Nn(ae,ae.return,bt)}}}else if(c.tag===6){if(d===null){ae=c;try{ae.stateNode.nodeValue=k?"":ae.memoizedProps}catch(bt){Nn(ae,ae.return,bt)}}}else if(c.tag===18){if(d===null){ae=c;try{var Oe=ae.stateNode;k?kx(Oe,!0):kx(ae.stateNode,!1)}catch(bt){Nn(ae,ae.return,bt)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=s.updateQueue,y!==null&&(d=y.retryQueue,d!==null&&(y.retryQueue=null,Xd(s,d))));break;case 19:dr(c,s),fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Xd(s,y)));break;case 30:break;case 21:break;default:dr(c,s),fr(s)}}function fr(s){var c=s.flags;if(c&2){try{for(var d,y=s.return;y!==null;){if(T1(y)){d=y;break}y=y.return}if(d==null)throw Error(i(160));switch(d.tag){case 27:var k=d.stateNode,T=Mg(s);Yd(s,T,k);break;case 5:var j=d.stateNode;d.flags&32&&(Rt(j,""),d.flags&=-33);var X=Mg(s);Yd(s,X,j);break;case 3:case 4:var ae=d.stateNode.containerInfo,Ae=Mg(s);Rg(s,Ae,ae);break;default:throw Error(i(161))}}catch(Le){Nn(s,s.return,Le)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function z1(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;z1(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function wa(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)O1(s,c.alternate,c),c=c.sibling}function al(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:uo(4,c,c.return),al(c);break;case 1:Ps(c,c.return);var d=c.stateNode;typeof d.componentWillUnmount=="function"&&k1(c,c.return,d),al(c);break;case 27:nh(c.stateNode);case 26:case 5:Ps(c,c.return),al(c);break;case 22:c.memoizedState===null&&al(c);break;case 30:al(c);break;default:al(c)}s=s.sibling}}function Ca(s,c,d){for(d=d&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,k=s,T=c,j=T.flags;switch(T.tag){case 0:case 11:case 15:Ca(k,T,d),$u(4,T);break;case 1:if(Ca(k,T,d),y=T,k=y.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(Ae){Nn(y,y.return,Ae)}if(y=T,k=y.updateQueue,k!==null){var X=y.stateNode;try{var ae=k.shared.hiddenCallbacks;if(ae!==null)for(k.shared.hiddenCallbacks=null,k=0;k<ae.length;k++)pv(ae[k],X)}catch(Ae){Nn(y,y.return,Ae)}}d&&j&64&&E1(T),Gu(T,T.return);break;case 27:M1(T);case 26:case 5:Ca(k,T,d),d&&y===null&&j&4&&A1(T),Gu(T,T.return);break;case 12:Ca(k,T,d);break;case 31:Ca(k,T,d),d&&j&4&&I1(k,T);break;case 13:Ca(k,T,d),d&&j&4&&L1(k,T);break;case 22:T.memoizedState===null&&Ca(k,T,d),Gu(T,T.return);break;case 30:break;default:Ca(k,T,d)}c=c.sibling}}function Ng(s,c){var d=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==d&&(s!=null&&s.refCount++,d!=null&&Du(d))}function Dg(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Du(s))}function ds(s,c,d,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)P1(s,c,d,y),c=c.sibling}function P1(s,c,d,y){var k=c.flags;switch(c.tag){case 0:case 11:case 15:ds(s,c,d,y),k&2048&&$u(9,c);break;case 1:ds(s,c,d,y);break;case 3:ds(s,c,d,y),k&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Du(s)));break;case 12:if(k&2048){ds(s,c,d,y),s=c.stateNode;try{var T=c.memoizedProps,j=T.id,X=T.onPostCommit;typeof X=="function"&&X(j,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ae){Nn(c,c.return,ae)}}else ds(s,c,d,y);break;case 31:ds(s,c,d,y);break;case 13:ds(s,c,d,y);break;case 23:break;case 22:T=c.stateNode,j=c.alternate,c.memoizedState!==null?T._visibility&2?ds(s,c,d,y):Ku(s,c):T._visibility&2?ds(s,c,d,y):(T._visibility|=2,uc(s,c,d,y,(c.subtreeFlags&10256)!==0||!1)),k&2048&&Ng(j,c);break;case 24:ds(s,c,d,y),k&2048&&Dg(c.alternate,c);break;default:ds(s,c,d,y)}}function uc(s,c,d,y,k){for(k=k&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var T=s,j=c,X=d,ae=y,Ae=j.flags;switch(j.tag){case 0:case 11:case 15:uc(T,j,X,ae,k),$u(8,j);break;case 23:break;case 22:var Le=j.stateNode;j.memoizedState!==null?Le._visibility&2?uc(T,j,X,ae,k):Ku(T,j):(Le._visibility|=2,uc(T,j,X,ae,k)),k&&Ae&2048&&Ng(j.alternate,j);break;case 24:uc(T,j,X,ae,k),k&&Ae&2048&&Dg(j.alternate,j);break;default:uc(T,j,X,ae,k)}c=c.sibling}}function Ku(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var d=s,y=c,k=y.flags;switch(y.tag){case 22:Ku(d,y),k&2048&&Ng(y.alternate,y);break;case 24:Ku(d,y),k&2048&&Dg(y.alternate,y);break;default:Ku(d,y)}c=c.sibling}}var Yu=8192;function hc(s,c,d){if(s.subtreeFlags&Yu)for(s=s.child;s!==null;)F1(s,c,d),s=s.sibling}function F1(s,c,d){switch(s.tag){case 26:hc(s,c,d),s.flags&Yu&&s.memoizedState!==null&&TT(d,hs,s.memoizedState,s.memoizedProps);break;case 5:hc(s,c,d);break;case 3:case 4:var y=hs;hs=hf(s.stateNode.containerInfo),hc(s,c,d),hs=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=Yu,Yu=16777216,hc(s,c,d),Yu=y):hc(s,c,d));break;default:hc(s,c,d)}}function j1(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function Xu(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var y=c[d];Ri=y,H1(y,s)}j1(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)U1(s),s=s.sibling}function U1(s){switch(s.tag){case 0:case 11:case 15:Xu(s),s.flags&2048&&uo(9,s,s.return);break;case 3:Xu(s);break;case 12:Xu(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Zd(s)):Xu(s);break;default:Xu(s)}}function Zd(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var y=c[d];Ri=y,H1(y,s)}j1(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:uo(8,c,c.return),Zd(c);break;case 22:d=c.stateNode,d._visibility&2&&(d._visibility&=-3,Zd(c));break;default:Zd(c)}s=s.sibling}}function H1(s,c){for(;Ri!==null;){var d=Ri;switch(d.tag){case 0:case 11:case 15:uo(8,d,c);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var y=d.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Du(d.memoizedState.cache)}if(y=d.child,y!==null)y.return=d,Ri=y;else e:for(d=s;Ri!==null;){y=Ri;var k=y.sibling,T=y.return;if(N1(y),y===d){Ri=null;break e}if(k!==null){k.return=T,Ri=k;break e}Ri=T}}}var qA={getCacheForType:function(s){var c=Bi(fi),d=c.data.get(s);return d===void 0&&(d=s(),c.data.set(s,d)),d},cacheSignal:function(){return Bi(fi).controller.signal}},VA=typeof WeakMap=="function"?WeakMap:Map,An=0,Fn=null,on=null,un=0,On=0,Cr=null,ho=!1,dc=!1,Ig=!1,Ea=0,ai=0,fo=0,ol=0,Lg=0,Er=0,fc=0,Zu=null,pr=null,Bg=!1,Jd=0,q1=0,Qd=1/0,ef=null,po=null,Ci=0,mo=null,pc=null,ka=0,zg=0,Pg=null,V1=null,Ju=0,Fg=null;function kr(){return(An&2)!==0&&un!==0?un&-un:Z.T!==null?Wg():rs()}function W1(){if(Er===0)if((un&536870912)===0||dn){var s=ks;ks<<=1,(ks&3932160)===0&&(ks=262144),Er=s}else Er=536870912;return s=Sr.current,s!==null&&(s.flags|=32),Er}function mr(s,c,d){(s===Fn&&(On===2||On===9)||s.cancelPendingCommit!==null)&&(mc(s,0),go(s,un,Er,!1)),fn(s,d),((An&2)===0||s!==Fn)&&(s===Fn&&((An&2)===0&&(ol|=d),ai===4&&go(s,un,Er,!1)),Fs(s))}function $1(s,c,d){if((An&6)!==0)throw Error(i(327));var y=!d&&(c&127)===0&&(c&s.expiredLanes)===0||Be(s,c),k=y?GA(s,c):Ug(s,c,!0),T=y;do{if(k===0){dc&&!y&&go(s,c,0,!1);break}else{if(d=s.current.alternate,T&&!WA(d)){k=Ug(s,c,!1),T=!1;continue}if(k===2){if(T=c,s.errorRecoveryDisabledLanes&T)var j=0;else j=s.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){c=j;e:{var X=s;k=Zu;var ae=X.current.memoizedState.isDehydrated;if(ae&&(mc(X,j).flags|=256),j=Ug(X,j,!1),j!==2){if(Ig&&!ae){X.errorRecoveryDisabledLanes|=T,ol|=T,k=4;break e}T=pr,pr=k,T!==null&&(pr===null?pr=T:pr.push.apply(pr,T))}k=j}if(T=!1,k!==2)continue}}if(k===1){mc(s,0),go(s,c,0,!0);break}e:{switch(y=s,T=k,T){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:go(y,c,Er,!ho);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(k=Jd+300-st(),10<k)){if(go(y,c,Er,!ho),oe(y,0,!0)!==0)break e;ka=c,y.timeoutHandle=wx(G1.bind(null,y,d,pr,ef,Bg,c,Er,ol,fc,ho,T,"Throttled",-0,0),k);break e}G1(y,d,pr,ef,Bg,c,Er,ol,fc,ho,T,null,-0,0)}}break}while(!0);Fs(s)}function G1(s,c,d,y,k,T,j,X,ae,Ae,Le,je,Me,Oe){if(s.timeoutHandle=-1,je=c.subtreeFlags,je&8192||(je&16785408)===16785408){je={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tt},F1(c,T,je);var bt=(T&62914560)===T?Jd-st():(T&4194048)===T?q1-st():0;if(bt=MT(je,bt),bt!==null){ka=T,s.cancelPendingCommit=bt(tx.bind(null,s,c,T,d,y,k,j,X,ae,Le,je,null,Me,Oe)),go(s,T,j,!Ae);return}}tx(s,c,T,d,y,k,j,X,ae)}function WA(s){for(var c=s;;){var d=c.tag;if((d===0||d===11||d===15)&&c.flags&16384&&(d=c.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var y=0;y<d.length;y++){var k=d[y],T=k.getSnapshot;k=k.value;try{if(!qi(T(),k))return!1}catch{return!1}}if(d=c.child,c.subtreeFlags&16384&&d!==null)d.return=c,c=d;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function go(s,c,d,y){c&=~Lg,c&=~ol,s.suspendedLanes|=c,s.pingedLanes&=~c,y&&(s.warmLanes|=c),y=s.expirationTimes;for(var k=c;0<k;){var T=31-et(k),j=1<<T;y[T]=-1,k&=~j}d!==0&&dt(s,d,c)}function tf(){return(An&6)===0?(Qu(0),!1):!0}function jg(){if(on!==null){if(On===0)var s=on.return;else s=on,ma=Jo=null,ng(s),sc=null,Lu=0,s=on;for(;s!==null;)C1(s.alternate,s),s=s.return;on=null}}function mc(s,c){var d=s.timeoutHandle;d!==-1&&(s.timeoutHandle=-1,hT(d)),d=s.cancelPendingCommit,d!==null&&(s.cancelPendingCommit=null,d()),ka=0,jg(),Fn=s,on=d=fa(s.current,null),un=c,On=0,Cr=null,ho=!1,dc=Be(s,c),Ig=!1,fc=Er=Lg=ol=fo=ai=0,pr=Zu=null,Bg=!1,(c&8)!==0&&(c|=c&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=c;0<y;){var k=31-et(y),T=1<<k;c|=s[k],y&=~T}return Ea=c,Wt(),d}function K1(s,c){Xt=null,Z.H=qu,c===rc||c===Rd?(c=uv(),On=3):c===Vm?(c=uv(),On=4):On=c===_g?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Cr=c,on===null&&(ai=1,Vd(s,Vr(c,s.current)))}function Y1(){var s=Sr.current;return s===null?!0:(un&4194048)===un?Kr===null:(un&62914560)===un||(un&536870912)!==0?s===Kr:!1}function X1(){var s=Z.H;return Z.H=qu,s===null?qu:s}function Z1(){var s=Z.A;return Z.A=qA,s}function nf(){ai=4,ho||(un&4194048)!==un&&Sr.current!==null||(dc=!0),(fo&134217727)===0&&(ol&134217727)===0||Fn===null||go(Fn,un,Er,!1)}function Ug(s,c,d){var y=An;An|=2;var k=X1(),T=Z1();(Fn!==s||un!==c)&&(ef=null,mc(s,c)),c=!1;var j=ai;e:do try{if(On!==0&&on!==null){var X=on,ae=Cr;switch(On){case 8:jg(),j=6;break e;case 3:case 2:case 9:case 6:Sr.current===null&&(c=!0);var Ae=On;if(On=0,Cr=null,gc(s,X,ae,Ae),d&&dc){j=0;break e}break;default:Ae=On,On=0,Cr=null,gc(s,X,ae,Ae)}}$A(),j=ai;break}catch(Le){K1(s,Le)}while(!0);return c&&s.shellSuspendCounter++,ma=Jo=null,An=y,Z.H=k,Z.A=T,on===null&&(Fn=null,un=0,Wt()),j}function $A(){for(;on!==null;)J1(on)}function GA(s,c){var d=An;An|=2;var y=X1(),k=Z1();Fn!==s||un!==c?(ef=null,Qd=st()+500,mc(s,c)):dc=Be(s,c);e:do try{if(On!==0&&on!==null){c=on;var T=Cr;t:switch(On){case 1:On=0,Cr=null,gc(s,c,T,1);break;case 2:case 9:if(lv(T)){On=0,Cr=null,Q1(c);break}c=function(){On!==2&&On!==9||Fn!==s||(On=7),Fs(s)},T.then(c,c);break e;case 3:On=7;break e;case 4:On=5;break e;case 7:lv(T)?(On=0,Cr=null,Q1(c)):(On=0,Cr=null,gc(s,c,T,7));break;case 5:var j=null;switch(on.tag){case 26:j=on.memoizedState;case 5:case 27:var X=on;if(j?Px(j):X.stateNode.complete){On=0,Cr=null;var ae=X.sibling;if(ae!==null)on=ae;else{var Ae=X.return;Ae!==null?(on=Ae,rf(Ae)):on=null}break t}}On=0,Cr=null,gc(s,c,T,5);break;case 6:On=0,Cr=null,gc(s,c,T,6);break;case 8:jg(),ai=6;break e;default:throw Error(i(462))}}KA();break}catch(Le){K1(s,Le)}while(!0);return ma=Jo=null,Z.H=y,Z.A=k,An=d,on!==null?0:(Fn=null,un=0,Wt(),ai)}function KA(){for(;on!==null&&!Re();)J1(on)}function J1(s){var c=S1(s.alternate,s,Ea);s.memoizedProps=s.pendingProps,c===null?rf(s):on=c}function Q1(s){var c=s,d=c.alternate;switch(c.tag){case 15:case 0:c=g1(d,c,c.pendingProps,c.type,void 0,un);break;case 11:c=g1(d,c,c.pendingProps,c.type.render,c.ref,un);break;case 5:ng(c);default:C1(d,c),c=on=Zb(c,Ea),c=S1(d,c,Ea)}s.memoizedProps=s.pendingProps,c===null?rf(s):on=c}function gc(s,c,d,y){ma=Jo=null,ng(c),sc=null,Lu=0;var k=c.return;try{if(BA(s,k,c,d,un)){ai=1,Vd(s,Vr(d,s.current)),on=null;return}}catch(T){if(k!==null)throw on=k,T;ai=1,Vd(s,Vr(d,s.current)),on=null;return}c.flags&32768?(dn||y===1?s=!0:dc||(un&536870912)!==0?s=!1:(ho=s=!0,(y===2||y===9||y===3||y===6)&&(y=Sr.current,y!==null&&y.tag===13&&(y.flags|=16384))),ex(c,s)):rf(c)}function rf(s){var c=s;do{if((c.flags&32768)!==0){ex(c,ho);return}s=c.return;var d=FA(c.alternate,c,Ea);if(d!==null){on=d;return}if(c=c.sibling,c!==null){on=c;return}on=c=s}while(c!==null);ai===0&&(ai=5)}function ex(s,c){do{var d=jA(s.alternate,s);if(d!==null){d.flags&=32767,on=d;return}if(d=s.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!c&&(s=s.sibling,s!==null)){on=s;return}on=s=d}while(s!==null);ai=6,on=null}function tx(s,c,d,y,k,T,j,X,ae){s.cancelPendingCommit=null;do sf();while(Ci!==0);if((An&6)!==0)throw Error(i(327));if(c!==null){if(c===s.current)throw Error(i(177));if(T=c.lanes|c.childLanes,T|=At,_t(s,d,T,j,X,ae),s===Fn&&(on=Fn=null,un=0),pc=c,mo=s,ka=d,zg=T,Pg=k,V1=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,JA(ft,function(){return ax(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=Z.T,Z.T=null,k=ie.p,ie.p=2,j=An,An|=4;try{UA(s,c,d)}finally{An=j,ie.p=k,Z.T=y}}Ci=1,nx(),ix(),rx()}}function nx(){if(Ci===1){Ci=0;var s=mo,c=pc,d=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null;var y=ie.p;ie.p=2;var k=An;An|=4;try{B1(c,s);var T=Qg,j=q(s.containerInfo),X=T.focusedElem,ae=T.selectionRange;if(j!==X&&X&&X.ownerDocument&&z(X.ownerDocument.documentElement,X)){if(ae!==null&&G(X)){var Ae=ae.start,Le=ae.end;if(Le===void 0&&(Le=Ae),"selectionStart"in X)X.selectionStart=Ae,X.selectionEnd=Math.min(Le,X.value.length);else{var je=X.ownerDocument||document,Me=je&&je.defaultView||window;if(Me.getSelection){var Oe=Me.getSelection(),bt=X.textContent.length,Bt=Math.min(ae.start,bt),Bn=ae.end===void 0?Bt:Math.min(ae.end,bt);!Oe.extend&&Bt>Bn&&(j=Bn,Bn=Bt,Bt=j);var ve=I(X,Bt),me=I(X,Bn);if(ve&&me&&(Oe.rangeCount!==1||Oe.anchorNode!==ve.node||Oe.anchorOffset!==ve.offset||Oe.focusNode!==me.node||Oe.focusOffset!==me.offset)){var ke=je.createRange();ke.setStart(ve.node,ve.offset),Oe.removeAllRanges(),Bt>Bn?(Oe.addRange(ke),Oe.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),Oe.addRange(ke))}}}}for(je=[],Oe=X;Oe=Oe.parentNode;)Oe.nodeType===1&&je.push({element:Oe,left:Oe.scrollLeft,top:Oe.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<je.length;X++){var Pe=je[X];Pe.element.scrollLeft=Pe.left,Pe.element.scrollTop=Pe.top}}yf=!!Jg,Qg=Jg=null}finally{An=k,ie.p=y,Z.T=d}}s.current=c,Ci=2}}function ix(){if(Ci===2){Ci=0;var s=mo,c=pc,d=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||d){d=Z.T,Z.T=null;var y=ie.p;ie.p=2;var k=An;An|=4;try{O1(s,c.alternate,c)}finally{An=k,ie.p=y,Z.T=d}}Ci=3}}function rx(){if(Ci===4||Ci===3){Ci=0,He();var s=mo,c=pc,d=ka,y=V1;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Ci=5:(Ci=0,pc=mo=null,sx(s,s.pendingLanes));var k=s.pendingLanes;if(k===0&&(po=null),ur(d),c=c.stateNode,Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(Pn,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=Z.T,k=ie.p,ie.p=2,Z.T=null;try{for(var T=s.onRecoverableError,j=0;j<y.length;j++){var X=y[j];T(X.value,{componentStack:X.stack})}}finally{Z.T=c,ie.p=k}}(ka&3)!==0&&sf(),Fs(s),k=s.pendingLanes,(d&261930)!==0&&(k&42)!==0?s===Fg?Ju++:(Ju=0,Fg=s):Ju=0,Qu(0)}}function sx(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Du(c)))}function sf(){return nx(),ix(),rx(),ax()}function ax(){if(Ci!==5)return!1;var s=mo,c=zg;zg=0;var d=ur(ka),y=Z.T,k=ie.p;try{ie.p=32>d?32:d,Z.T=null,d=Pg,Pg=null;var T=mo,j=ka;if(Ci=0,pc=mo=null,ka=0,(An&6)!==0)throw Error(i(331));var X=An;if(An|=4,U1(T.current),P1(T,T.current,j,d),An=X,Qu(0,!1),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(Pn,T)}catch{}return!0}finally{ie.p=k,Z.T=y,sx(s,c)}}function ox(s,c,d){c=Vr(d,c),c=yg(s.stateNode,c,2),s=oo(s,c,2),s!==null&&(fn(s,2),Fs(s))}function Nn(s,c,d){if(s.tag===3)ox(s,s,d);else for(;c!==null;){if(c.tag===3){ox(c,s,d);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(po===null||!po.has(y))){s=Vr(d,s),d=l1(2),y=oo(c,d,2),y!==null&&(c1(d,y,c,s),fn(y,2),Fs(y));break}}c=c.return}}function Hg(s,c,d){var y=s.pingCache;if(y===null){y=s.pingCache=new VA;var k=new Set;y.set(c,k)}else k=y.get(c),k===void 0&&(k=new Set,y.set(c,k));k.has(d)||(Ig=!0,k.add(d),s=YA.bind(null,s,c,d),c.then(s,s))}function YA(s,c,d){var y=s.pingCache;y!==null&&y.delete(c),s.pingedLanes|=s.suspendedLanes&d,s.warmLanes&=~d,Fn===s&&(un&d)===d&&(ai===4||ai===3&&(un&62914560)===un&&300>st()-Jd?(An&2)===0&&mc(s,0):Lg|=d,fc===un&&(fc=0)),Fs(s)}function lx(s,c){c===0&&(c=Ft()),s=Rn(s,c),s!==null&&(fn(s,c),Fs(s))}function XA(s){var c=s.memoizedState,d=0;c!==null&&(d=c.retryLane),lx(s,d)}function ZA(s,c){var d=0;switch(s.tag){case 31:case 13:var y=s.stateNode,k=s.memoizedState;k!==null&&(d=k.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(c),lx(s,d)}function JA(s,c){return St(s,c)}var af=null,yc=null,qg=!1,of=!1,Vg=!1,yo=0;function Fs(s){s!==yc&&s.next===null&&(yc===null?af=yc=s:yc=yc.next=s),of=!0,qg||(qg=!0,eT())}function Qu(s,c){if(!Vg&&of){Vg=!0;do for(var d=!1,y=af;y!==null;){if(s!==0){var k=y.pendingLanes;if(k===0)var T=0;else{var j=y.suspendedLanes,X=y.pingedLanes;T=(1<<31-et(42|s)+1)-1,T&=k&~(j&~X),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(d=!0,dx(y,T))}else T=un,T=oe(y,y===Fn?T:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(T&3)===0||Be(y,T)||(d=!0,dx(y,T));y=y.next}while(d);Vg=!1}}function QA(){cx()}function cx(){of=qg=!1;var s=0;yo!==0&&uT()&&(s=yo);for(var c=st(),d=null,y=af;y!==null;){var k=y.next,T=ux(y,c);T===0?(y.next=null,d===null?af=k:d.next=k,k===null&&(yc=d)):(d=y,(s!==0||(T&3)!==0)&&(of=!0)),y=k}Ci!==0&&Ci!==5||Qu(s),yo!==0&&(yo=0)}function ux(s,c){for(var d=s.suspendedLanes,y=s.pingedLanes,k=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var j=31-et(T),X=1<<j,ae=k[j];ae===-1?((X&d)===0||(X&y)!==0)&&(k[j]=ot(X,c)):ae<=c&&(s.expiredLanes|=X),T&=~X}if(c=Fn,d=un,d=oe(s,s===c?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,d===0||s===c&&(On===2||On===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&Tt(y),s.callbackNode=null,s.callbackPriority=0;if((d&3)===0||Be(s,d)){if(c=d&-d,c===s.callbackPriority)return c;switch(y!==null&&Tt(y),ur(d)){case 2:case 8:d=Ve;break;case 32:d=ft;break;case 268435456:d=Pt;break;default:d=ft}return y=hx.bind(null,s),d=St(d,y),s.callbackPriority=c,s.callbackNode=d,c}return y!==null&&y!==null&&Tt(y),s.callbackPriority=2,s.callbackNode=null,2}function hx(s,c){if(Ci!==0&&Ci!==5)return s.callbackNode=null,s.callbackPriority=0,null;var d=s.callbackNode;if(sf()&&s.callbackNode!==d)return null;var y=un;return y=oe(s,s===Fn?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:($1(s,y,c),ux(s,st()),s.callbackNode!=null&&s.callbackNode===d?hx.bind(null,s):null)}function dx(s,c){if(sf())return null;$1(s,c,!0)}function eT(){dT(function(){(An&6)!==0?St(_e,QA):cx()})}function Wg(){if(yo===0){var s=nc;s===0&&(s=rt,rt<<=1,(rt&261888)===0&&(rt=256)),yo=s}return yo}function fx(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:er(""+s)}function px(s,c){var d=c.ownerDocument.createElement("input");return d.name=c.name,d.value=c.value,s.id&&d.setAttribute("form",s.id),c.parentNode.insertBefore(d,c),s=new FormData(s),d.parentNode.removeChild(d),s}function tT(s,c,d,y,k){if(c==="submit"&&d&&d.stateNode===k){var T=fx((k[Qn]||null).action),j=y.submitter;j&&(c=(c=j[Qn]||null)?fx(c.formAction):j.getAttribute("formAction"),c!==null&&(T=c,j=null));var X=new Bl("action","action",null,y,k);s.push({event:X,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(yo!==0){var ae=j?px(k,j):new FormData(k);hg(d,{pending:!0,data:ae,method:k.method,action:T},null,ae)}}else typeof T=="function"&&(X.preventDefault(),ae=j?px(k,j):new FormData(k),hg(d,{pending:!0,data:ae,method:k.method,action:T},T,ae))},currentTarget:k}]})}}for(var $g=0;$g<ct.length;$g++){var Gg=ct[$g],nT=Gg.toLowerCase(),iT=Gg[0].toUpperCase()+Gg.slice(1);Ke(nT,"on"+iT)}Ke(Te,"onAnimationEnd"),Ke(we,"onAnimationIteration"),Ke(Ie,"onAnimationStart"),Ke("dblclick","onDoubleClick"),Ke("focusin","onFocus"),Ke("focusout","onBlur"),Ke($e,"onTransitionRun"),Ke(nt,"onTransitionStart"),Ke(it,"onTransitionCancel"),Ke(Ge,"onTransitionEnd"),Xe("onMouseEnter",["mouseout","mouseover"]),Xe("onMouseLeave",["mouseout","mouseover"]),Xe("onPointerEnter",["pointerout","pointerover"]),Xe("onPointerLeave",["pointerout","pointerover"]),vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eh="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(" "),rT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eh));function mx(s,c){c=(c&4)!==0;for(var d=0;d<s.length;d++){var y=s[d],k=y.event;y=y.listeners;e:{var T=void 0;if(c)for(var j=y.length-1;0<=j;j--){var X=y[j],ae=X.instance,Ae=X.currentTarget;if(X=X.listener,ae!==T&&k.isPropagationStopped())break e;T=X,k.currentTarget=Ae;try{T(k)}catch(Le){mt(Le)}k.currentTarget=null,T=ae}else for(j=0;j<y.length;j++){if(X=y[j],ae=X.instance,Ae=X.currentTarget,X=X.listener,ae!==T&&k.isPropagationStopped())break e;T=X,k.currentTarget=Ae;try{T(k)}catch(Le){mt(Le)}k.currentTarget=null,T=ae}}}}function ln(s,c){var d=c[Ts];d===void 0&&(d=c[Ts]=new Set);var y=s+"__bubble";d.has(y)||(gx(c,s,2,!1),d.add(y))}function Kg(s,c,d){var y=0;c&&(y|=4),gx(d,s,y,c)}var lf="_reactListening"+Math.random().toString(36).slice(2);function Yg(s){if(!s[lf]){s[lf]=!0,as.forEach(function(d){d!=="selectionchange"&&(rT.has(d)||Kg(d,!1,s),Kg(d,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[lf]||(c[lf]=!0,Kg("selectionchange",!1,c))}}function gx(s,c,d,y){switch(Wx(c)){case 2:var k=NT;break;case 8:k=DT;break;default:k=uy}d=k.bind(null,c,d,s),k=void 0,!yu||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(k=!0),y?k!==void 0?s.addEventListener(c,d,{capture:!0,passive:k}):s.addEventListener(c,d,!0):k!==void 0?s.addEventListener(c,d,{passive:k}):s.addEventListener(c,d,!1)}function Xg(s,c,d,y,k){var T=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var j=y.tag;if(j===3||j===4){var X=y.stateNode.containerInfo;if(X===k)break;if(j===4)for(j=y.return;j!==null;){var ae=j.tag;if((ae===3||ae===4)&&j.stateNode.containerInfo===k)return;j=j.return}for(;X!==null;){if(j=xi(X),j===null)return;if(ae=j.tag,ae===5||ae===6||ae===26||ae===27){y=T=j;continue e}X=X.parentNode}}y=y.return}Os(function(){var Ae=T,Le=qt(d),je=[];e:{var Me=pt.get(s);if(Me!==void 0){var Oe=Bl,bt=s;switch(s){case"keypress":if(Ka(d)===0)break e;case"keydown":case"keyup":Oe=ql;break;case"focusin":bt="focus",Oe=Ya;break;case"focusout":bt="blur",Oe=Ya;break;case"beforeblur":case"afterblur":Oe=Ya;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=Fl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=pd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=Cu;break;case Te:case we:case Ie:Oe=md;break;case Ge:Oe=Eu;break;case"scroll":case"scrollend":Oe=zl;break;case"wheel":Oe=Wl;break;case"copy":case"cut":case"paste":Oe=Xa;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=wu;break;case"toggle":case"beforetoggle":Oe=_d}var Bt=(c&4)!==0,Bn=!Bt&&(s==="scroll"||s==="scrollend"),ve=Bt?Me!==null?Me+"Capture":null:Me;Bt=[];for(var me=Ae,ke;me!==null;){var Pe=me;if(ke=Pe.stateNode,Pe=Pe.tag,Pe!==5&&Pe!==26&&Pe!==27||ke===null||ve===null||(Pe=aa(me,ve),Pe!=null&&Bt.push(th(me,Pe,ke))),Bn)break;me=me.return}0<Bt.length&&(Me=new Oe(Me,bt,null,d,Le),je.push({event:Me,listeners:Bt}))}}if((c&7)===0){e:{if(Me=s==="mouseover"||s==="pointerover",Oe=s==="mouseout"||s==="pointerout",Me&&d!==yt&&(bt=d.relatedTarget||d.fromElement)&&(xi(bt)||bt[Di]))break e;if((Oe||Me)&&(Me=Le.window===Le?Le:(Me=Le.ownerDocument)?Me.defaultView||Me.parentWindow:window,Oe?(bt=d.relatedTarget||d.toElement,Oe=Ae,bt=bt?xi(bt):null,bt!==null&&(Bn=a(bt),Bt=bt.tag,bt!==Bn||Bt!==5&&Bt!==27&&Bt!==6)&&(bt=null)):(Oe=null,bt=Ae),Oe!==bt)){if(Bt=Fl,Pe="onMouseLeave",ve="onMouseEnter",me="mouse",(s==="pointerout"||s==="pointerover")&&(Bt=wu,Pe="onPointerLeave",ve="onPointerEnter",me="pointer"),Bn=Oe==null?Me:ji(Oe),ke=bt==null?Me:ji(bt),Me=new Bt(Pe,me+"leave",Oe,d,Le),Me.target=Bn,Me.relatedTarget=ke,Pe=null,xi(Le)===Ae&&(Bt=new Bt(ve,me+"enter",bt,d,Le),Bt.target=ke,Bt.relatedTarget=Bn,Pe=Bt),Bn=Pe,Oe&&bt)t:{for(Bt=sT,ve=Oe,me=bt,ke=0,Pe=ve;Pe;Pe=Bt(Pe))ke++;Pe=0;for(var Mt=me;Mt;Mt=Bt(Mt))Pe++;for(;0<ke-Pe;)ve=Bt(ve),ke--;for(;0<Pe-ke;)me=Bt(me),Pe--;for(;ke--;){if(ve===me||me!==null&&ve===me.alternate){Bt=ve;break t}ve=Bt(ve),me=Bt(me)}Bt=null}else Bt=null;Oe!==null&&yx(je,Me,Oe,Bt,!1),bt!==null&&Bn!==null&&yx(je,Bn,bt,Bt,!0)}}e:{if(Me=Ae?ji(Ae):window,Oe=Me.nodeName&&Me.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&Me.type==="file")var vn=Yo;else if(Kl(Me))if(qr)vn=Qa;else{vn=da;var Ct=Cd}else Oe=Me.nodeName,!Oe||Oe.toLowerCase()!=="input"||Me.type!=="checkbox"&&Me.type!=="radio"?Ae&&Rs(Ae.elementType)&&(vn=Yo):vn=Ru;if(vn&&(vn=vn(s,Ae))){Mu(je,vn,d,Le);break e}Ct&&Ct(s,Me,Ae),s==="focusout"&&Ae&&Me.type==="number"&&Ae.memoizedProps.value!=null&&Ms(Me,"number",Me.value)}switch(Ct=Ae?ji(Ae):window,s){case"focusin":(Kl(Ct)||Ct.contentEditable==="true")&&(re=Ct,ue=Ae,Se=null);break;case"focusout":Se=ue=re=null;break;case"mousedown":he=!0;break;case"contextmenu":case"mouseup":case"dragend":he=!1,ce(je,d,Le);break;case"selectionchange":if(te)break;case"keydown":case"keyup":ce(je,d,Le)}var Qt;if(Go)e:{switch(s){case"compositionstart":var hn="onCompositionStart";break e;case"compositionend":hn="onCompositionEnd";break e;case"compositionupdate":hn="onCompositionUpdate";break e}hn=void 0}else ua?Tu(s,d)&&(hn="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(hn="onCompositionStart");hn&&($l&&d.locale!=="ko"&&(ua||hn!=="onCompositionStart"?hn==="onCompositionEnd"&&ua&&(Qt=Ga()):(Hr=Le,Ll="value"in Hr?Hr.value:Hr.textContent,ua=!0)),Ct=cf(Ae,hn),0<Ct.length&&(hn=new Hl(hn,s,null,d,Le),je.push({event:hn,listeners:Ct}),Qt?hn.data=Qt:(Qt=vd(d),Qt!==null&&(hn.data=Qt)))),(Qt=Tm?xd(s,d):Mm(s,d))&&(hn=cf(Ae,"onBeforeInput"),0<hn.length&&(Ct=new Hl("onBeforeInput","beforeinput",null,d,Le),je.push({event:Ct,listeners:hn}),Ct.data=Qt)),tT(je,s,Ae,d,Le)}mx(je,c)})}function th(s,c,d){return{instance:s,listener:c,currentTarget:d}}function cf(s,c){for(var d=c+"Capture",y=[];s!==null;){var k=s,T=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||T===null||(k=aa(s,d),k!=null&&y.unshift(th(s,k,T)),k=aa(s,c),k!=null&&y.push(th(s,k,T))),s.tag===3)return y;s=s.return}return[]}function sT(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function yx(s,c,d,y,k){for(var T=c._reactName,j=[];d!==null&&d!==y;){var X=d,ae=X.alternate,Ae=X.stateNode;if(X=X.tag,ae!==null&&ae===y)break;X!==5&&X!==26&&X!==27||Ae===null||(ae=Ae,k?(Ae=aa(d,T),Ae!=null&&j.unshift(th(d,Ae,ae))):k||(Ae=aa(d,T),Ae!=null&&j.push(th(d,Ae,ae)))),d=d.return}j.length!==0&&s.push({event:c,listeners:j})}var aT=/\r\n?/g,oT=/\u0000|\uFFFD/g;function _x(s){return(typeof s=="string"?s:""+s).replace(aT,`
10
+ `).replace(oT,"")}function bx(s,c){return c=_x(c),_x(s)===c}function Ln(s,c,d,y,k,T){switch(d){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||Rt(s,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&Rt(s,""+y);break;case"className":Ui(s,"class",y);break;case"tabIndex":Ui(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Ui(s,d,y);break;case"style":bn(s,y,T);break;case"data":if(c!=="object"){Ui(s,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||d!=="href")){s.removeAttribute(d);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(d);break}y=er(""+y),s.setAttribute(d,y);break;case"action":case"formAction":if(typeof y=="function"){s.setAttribute(d,"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 T=="function"&&(d==="formAction"?(c!=="input"&&Ln(s,c,"name",k.name,k,null),Ln(s,c,"formEncType",k.formEncType,k,null),Ln(s,c,"formMethod",k.formMethod,k,null),Ln(s,c,"formTarget",k.formTarget,k,null)):(Ln(s,c,"encType",k.encType,k,null),Ln(s,c,"method",k.method,k,null),Ln(s,c,"target",k.target,k,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(d);break}y=er(""+y),s.setAttribute(d,y);break;case"onClick":y!=null&&(s.onclick=tt);break;case"onScroll":y!=null&&ln("scroll",s);break;case"onScrollEnd":y!=null&&ln("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(d=y.__html,d!=null){if(k.children!=null)throw Error(i(60));s.innerHTML=d}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}d=er(""+y),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,""+y):s.removeAttribute(d);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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,""):s.removeAttribute(d);break;case"capture":case"download":y===!0?s.setAttribute(d,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(d,y):s.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(d,y):s.removeAttribute(d);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(d):s.setAttribute(d,y);break;case"popover":ln("beforetoggle",s),ln("toggle",s),Dt(s,"popover",y);break;case"xlinkActuate":Ii(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ii(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ii(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ii(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ii(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ii(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ii(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Dt(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=cs.get(d)||d,Dt(s,d,y))}}function Zg(s,c,d,y,k,T){switch(d){case"style":bn(s,y,T);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(d=y.__html,d!=null){if(k.children!=null)throw Error(i(60));s.innerHTML=d}}break;case"children":typeof y=="string"?Rt(s,y):(typeof y=="number"||typeof y=="bigint")&&Rt(s,""+y);break;case"onScroll":y!=null&&ln("scroll",s);break;case"onScrollEnd":y!=null&&ln("scrollend",s);break;case"onClick":y!=null&&(s.onclick=tt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jr.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(k=d.endsWith("Capture"),c=d.slice(2,k?d.length-7:void 0),T=s[Qn]||null,T=T!=null?T[d]:null,typeof T=="function"&&s.removeEventListener(c,T,k),typeof y=="function")){typeof T!="function"&&T!==null&&(d in s?s[d]=null:s.hasAttribute(d)&&s.removeAttribute(d)),s.addEventListener(c,y,k);break e}d in s?s[d]=y:y===!0?s.setAttribute(d,""):Dt(s,d,y)}}}function Pi(s,c,d){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ln("error",s),ln("load",s);var y=!1,k=!1,T;for(T in d)if(d.hasOwnProperty(T)){var j=d[T];if(j!=null)switch(T){case"src":y=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:Ln(s,c,T,j,d,null)}}k&&Ln(s,c,"srcSet",d.srcSet,d,null),y&&Ln(s,c,"src",d.src,d,null);return;case"input":ln("invalid",s);var X=T=j=k=null,ae=null,Ae=null;for(y in d)if(d.hasOwnProperty(y)){var Le=d[y];if(Le!=null)switch(y){case"name":k=Le;break;case"type":j=Le;break;case"checked":ae=Le;break;case"defaultChecked":Ae=Le;break;case"value":T=Le;break;case"defaultValue":X=Le;break;case"children":case"dangerouslySetInnerHTML":if(Le!=null)throw Error(i(137,c));break;default:Ln(s,c,y,Le,d,null)}}os(s,T,X,ae,Ae,j,k,!1);return;case"select":ln("invalid",s),y=j=T=null;for(k in d)if(d.hasOwnProperty(k)&&(X=d[k],X!=null))switch(k){case"value":T=X;break;case"defaultValue":j=X;break;case"multiple":y=X;default:Ln(s,c,k,X,d,null)}c=T,d=j,s.multiple=!!y,c!=null?ri(s,!!y,c,!1):d!=null&&ri(s,!!y,d,!0);return;case"textarea":ln("invalid",s),T=k=y=null;for(j in d)if(d.hasOwnProperty(j)&&(X=d[j],X!=null))switch(j){case"value":y=X;break;case"defaultValue":k=X;break;case"children":T=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(91));break;default:Ln(s,c,j,X,d,null)}ls(s,y,k,T);return;case"option":for(ae in d)d.hasOwnProperty(ae)&&(y=d[ae],y!=null)&&(ae==="selected"?s.selected=y&&typeof y!="function"&&typeof y!="symbol":Ln(s,c,ae,y,d,null));return;case"dialog":ln("beforetoggle",s),ln("toggle",s),ln("cancel",s),ln("close",s);break;case"iframe":case"object":ln("load",s);break;case"video":case"audio":for(y=0;y<eh.length;y++)ln(eh[y],s);break;case"image":ln("error",s),ln("load",s);break;case"details":ln("toggle",s);break;case"embed":case"source":case"link":ln("error",s),ln("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ae in d)if(d.hasOwnProperty(Ae)&&(y=d[Ae],y!=null))switch(Ae){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:Ln(s,c,Ae,y,d,null)}return;default:if(Rs(c)){for(Le in d)d.hasOwnProperty(Le)&&(y=d[Le],y!==void 0&&Zg(s,c,Le,y,d,void 0));return}}for(X in d)d.hasOwnProperty(X)&&(y=d[X],y!=null&&Ln(s,c,X,y,d,null))}function lT(s,c,d,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,T=null,j=null,X=null,ae=null,Ae=null,Le=null;for(Oe in d){var je=d[Oe];if(d.hasOwnProperty(Oe)&&je!=null)switch(Oe){case"checked":break;case"value":break;case"defaultValue":ae=je;default:y.hasOwnProperty(Oe)||Ln(s,c,Oe,null,y,je)}}for(var Me in y){var Oe=y[Me];if(je=d[Me],y.hasOwnProperty(Me)&&(Oe!=null||je!=null))switch(Me){case"type":T=Oe;break;case"name":k=Oe;break;case"checked":Ae=Oe;break;case"defaultChecked":Le=Oe;break;case"value":j=Oe;break;case"defaultValue":X=Oe;break;case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(i(137,c));break;default:Oe!==je&&Ln(s,c,Me,Oe,y,je)}}Ur(s,j,X,ae,Ae,Le,T,k);return;case"select":Oe=j=X=Me=null;for(T in d)if(ae=d[T],d.hasOwnProperty(T)&&ae!=null)switch(T){case"value":break;case"multiple":Oe=ae;default:y.hasOwnProperty(T)||Ln(s,c,T,null,y,ae)}for(k in y)if(T=y[k],ae=d[k],y.hasOwnProperty(k)&&(T!=null||ae!=null))switch(k){case"value":Me=T;break;case"defaultValue":X=T;break;case"multiple":j=T;default:T!==ae&&Ln(s,c,k,T,y,ae)}c=X,d=j,y=Oe,Me!=null?ri(s,!!d,Me,!1):!!y!=!!d&&(c!=null?ri(s,!!d,c,!0):ri(s,!!d,d?[]:"",!1));return;case"textarea":Oe=Me=null;for(X in d)if(k=d[X],d.hasOwnProperty(X)&&k!=null&&!y.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:Ln(s,c,X,null,y,k)}for(j in y)if(k=y[j],T=d[j],y.hasOwnProperty(j)&&(k!=null||T!=null))switch(j){case"value":Me=k;break;case"defaultValue":Oe=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(i(91));break;default:k!==T&&Ln(s,c,j,k,y,T)}Ho(s,Me,Oe);return;case"option":for(var bt in d)Me=d[bt],d.hasOwnProperty(bt)&&Me!=null&&!y.hasOwnProperty(bt)&&(bt==="selected"?s.selected=!1:Ln(s,c,bt,null,y,Me));for(ae in y)Me=y[ae],Oe=d[ae],y.hasOwnProperty(ae)&&Me!==Oe&&(Me!=null||Oe!=null)&&(ae==="selected"?s.selected=Me&&typeof Me!="function"&&typeof Me!="symbol":Ln(s,c,ae,Me,y,Oe));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 Bt in d)Me=d[Bt],d.hasOwnProperty(Bt)&&Me!=null&&!y.hasOwnProperty(Bt)&&Ln(s,c,Bt,null,y,Me);for(Ae in y)if(Me=y[Ae],Oe=d[Ae],y.hasOwnProperty(Ae)&&Me!==Oe&&(Me!=null||Oe!=null))switch(Ae){case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(i(137,c));break;default:Ln(s,c,Ae,Me,y,Oe)}return;default:if(Rs(c)){for(var Bn in d)Me=d[Bn],d.hasOwnProperty(Bn)&&Me!==void 0&&!y.hasOwnProperty(Bn)&&Zg(s,c,Bn,void 0,y,Me);for(Le in y)Me=y[Le],Oe=d[Le],!y.hasOwnProperty(Le)||Me===Oe||Me===void 0&&Oe===void 0||Zg(s,c,Le,Me,y,Oe);return}}for(var ve in d)Me=d[ve],d.hasOwnProperty(ve)&&Me!=null&&!y.hasOwnProperty(ve)&&Ln(s,c,ve,null,y,Me);for(je in y)Me=y[je],Oe=d[je],!y.hasOwnProperty(je)||Me===Oe||Me==null&&Oe==null||Ln(s,c,je,Me,y,Oe)}function vx(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cT(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,d=performance.getEntriesByType("resource"),y=0;y<d.length;y++){var k=d[y],T=k.transferSize,j=k.initiatorType,X=k.duration;if(T&&X&&vx(j)){for(j=0,X=k.responseEnd,y+=1;y<d.length;y++){var ae=d[y],Ae=ae.startTime;if(Ae>X)break;var Le=ae.transferSize,je=ae.initiatorType;Le&&vx(je)&&(ae=ae.responseEnd,j+=Le*(ae<X?1:(X-Ae)/(ae-Ae)))}if(--y,c+=8*(T+j)/(k.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Jg=null,Qg=null;function uf(s){return s.nodeType===9?s:s.ownerDocument}function xx(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sx(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function ey(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var ty=null;function uT(){var s=window.event;return s&&s.type==="popstate"?s===ty?!1:(ty=s,!0):(ty=null,!1)}var wx=typeof setTimeout=="function"?setTimeout:void 0,hT=typeof clearTimeout=="function"?clearTimeout:void 0,Cx=typeof Promise=="function"?Promise:void 0,dT=typeof queueMicrotask=="function"?queueMicrotask:typeof Cx<"u"?function(s){return Cx.resolve(null).then(s).catch(fT)}:wx;function fT(s){setTimeout(function(){throw s})}function _o(s){return s==="head"}function Ex(s,c){var d=c,y=0;do{var k=d.nextSibling;if(s.removeChild(d),k&&k.nodeType===8)if(d=k.data,d==="/$"||d==="/&"){if(y===0){s.removeChild(k),xc(c);return}y--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")y++;else if(d==="html")nh(s.ownerDocument.documentElement);else if(d==="head"){d=s.ownerDocument.head,nh(d);for(var T=d.firstChild;T;){var j=T.nextSibling,X=T.nodeName;T[Qi]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&T.rel.toLowerCase()==="stylesheet"||d.removeChild(T),T=j}}else d==="body"&&nh(s.ownerDocument.body);d=k}while(d);xc(c)}function kx(s,c){var d=s;s=0;do{var y=d.nextSibling;if(d.nodeType===1?c?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(c?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),y&&y.nodeType===8)if(d=y.data,d==="/$"){if(s===0)break;s--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||s++;d=y}while(d)}function ny(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var d=c;switch(c=c.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":ny(d),Va(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}s.removeChild(d)}}function pT(s,c,d,y){for(;s.nodeType===1;){var k=d;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[Qi])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==k.rel||s.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||s.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||s.getAttribute("title")!==(k.title==null?null:k.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(k.src==null?null:k.src)||s.getAttribute("type")!==(k.type==null?null:k.type)||s.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var T=k.name==null?null:""+k.name;if(k.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=Yr(s.nextSibling),s===null)break}return null}function mT(s,c,d){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!d||(s=Yr(s.nextSibling),s===null))return null;return s}function Ax(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Yr(s.nextSibling),s===null))return null;return s}function iy(s){return s.data==="$?"||s.data==="$~"}function ry(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function gT(s,c){var d=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||d.readyState!=="loading")c();else{var y=function(){c(),d.removeEventListener("DOMContentLoaded",y)};d.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function Yr(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var sy=null;function Tx(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var d=s.data;if(d==="/$"||d==="/&"){if(c===0)return Yr(s.nextSibling);c--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||c++}s=s.nextSibling}return null}function Mx(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(c===0)return s;c--}else d!=="/$"&&d!=="/&"||c++}s=s.previousSibling}return null}function Rx(s,c,d){switch(c=uf(d),s){case"html":if(s=c.documentElement,!s)throw Error(i(452));return s;case"head":if(s=c.head,!s)throw Error(i(453));return s;case"body":if(s=c.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function nh(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Va(s)}var Xr=new Map,Ox=new Set;function hf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Aa=ie.d;ie.d={f:yT,r:_T,D:bT,C:vT,L:xT,m:ST,X:CT,S:wT,M:ET};function yT(){var s=Aa.f(),c=tf();return s||c}function _T(s){var c=En(s);c!==null&&c.tag===5&&c.type==="form"?Kv(c):Aa.r(s)}var _c=typeof document>"u"?null:document;function Nx(s,c,d){var y=_c;if(y&&typeof c=="string"&&c){var k=hi(c);k='link[rel="'+s+'"][href="'+k+'"]',typeof d=="string"&&(k+='[crossorigin="'+d+'"]'),Ox.has(k)||(Ox.add(k),s={rel:s,crossOrigin:d,href:c},y.querySelector(k)===null&&(c=y.createElement("link"),Pi(c,"link",s),ei(c),y.head.appendChild(c)))}}function bT(s){Aa.D(s),Nx("dns-prefetch",s,null)}function vT(s,c){Aa.C(s,c),Nx("preconnect",s,c)}function xT(s,c,d){Aa.L(s,c,d);var y=_c;if(y&&s&&c){var k='link[rel="preload"][as="'+hi(c)+'"]';c==="image"&&d&&d.imageSrcSet?(k+='[imagesrcset="'+hi(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(k+='[imagesizes="'+hi(d.imageSizes)+'"]')):k+='[href="'+hi(s)+'"]';var T=k;switch(c){case"style":T=bc(s);break;case"script":T=vc(s)}Xr.has(T)||(s=f({rel:"preload",href:c==="image"&&d&&d.imageSrcSet?void 0:s,as:c},d),Xr.set(T,s),y.querySelector(k)!==null||c==="style"&&y.querySelector(ih(T))||c==="script"&&y.querySelector(rh(T))||(c=y.createElement("link"),Pi(c,"link",s),ei(c),y.head.appendChild(c)))}}function ST(s,c){Aa.m(s,c);var d=_c;if(d&&s){var y=c&&typeof c.as=="string"?c.as:"script",k='link[rel="modulepreload"][as="'+hi(y)+'"][href="'+hi(s)+'"]',T=k;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=vc(s)}if(!Xr.has(T)&&(s=f({rel:"modulepreload",href:s},c),Xr.set(T,s),d.querySelector(k)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(rh(T)))return}y=d.createElement("link"),Pi(y,"link",s),ei(y),d.head.appendChild(y)}}}function wT(s,c,d){Aa.S(s,c,d);var y=_c;if(y&&s){var k=Ai(y).hoistableStyles,T=bc(s);c=c||"default";var j=k.get(T);if(!j){var X={loading:0,preload:null};if(j=y.querySelector(ih(T)))X.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":c},d),(d=Xr.get(T))&&ay(s,d);var ae=j=y.createElement("link");ei(ae),Pi(ae,"link",s),ae._p=new Promise(function(Ae,Le){ae.onload=Ae,ae.onerror=Le}),ae.addEventListener("load",function(){X.loading|=1}),ae.addEventListener("error",function(){X.loading|=2}),X.loading|=4,df(j,c,y)}j={type:"stylesheet",instance:j,count:1,state:X},k.set(T,j)}}}function CT(s,c){Aa.X(s,c);var d=_c;if(d&&s){var y=Ai(d).hoistableScripts,k=vc(s),T=y.get(k);T||(T=d.querySelector(rh(k)),T||(s=f({src:s,async:!0},c),(c=Xr.get(k))&&oy(s,c),T=d.createElement("script"),ei(T),Pi(T,"link",s),d.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(k,T))}}function ET(s,c){Aa.M(s,c);var d=_c;if(d&&s){var y=Ai(d).hoistableScripts,k=vc(s),T=y.get(k);T||(T=d.querySelector(rh(k)),T||(s=f({src:s,async:!0,type:"module"},c),(c=Xr.get(k))&&oy(s,c),T=d.createElement("script"),ei(T),Pi(T,"link",s),d.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(k,T))}}function Dx(s,c,d,y){var k=(k=Ne.current)?hf(k):null;if(!k)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(c=bc(d.href),d=Ai(k).hoistableStyles,y=d.get(c),y||(y={type:"style",instance:null,count:0,state:null},d.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){s=bc(d.href);var T=Ai(k).hoistableStyles,j=T.get(s);if(j||(k=k.ownerDocument||k,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,j),(T=k.querySelector(ih(s)))&&!T._p&&(j.instance=T,j.state.loading=5),Xr.has(s)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Xr.set(s,d),T||kT(k,s,d,j.state))),c&&y===null)throw Error(i(528,""));return j}if(c&&y!==null)throw Error(i(529,""));return null;case"script":return c=d.async,d=d.src,typeof d=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=vc(d),d=Ai(k).hoistableScripts,y=d.get(c),y||(y={type:"script",instance:null,count:0,state:null},d.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function bc(s){return'href="'+hi(s)+'"'}function ih(s){return'link[rel="stylesheet"]['+s+"]"}function Ix(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function kT(s,c,d,y){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=s.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),Pi(c,"link",d),ei(c),s.head.appendChild(c))}function vc(s){return'[src="'+hi(s)+'"]'}function rh(s){return"script[async]"+s}function Lx(s,c,d){if(c.count++,c.instance===null)switch(c.type){case"style":var y=s.querySelector('style[data-href~="'+hi(d.href)+'"]');if(y)return c.instance=y,ei(y),y;var k=f({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),ei(y),Pi(y,"style",k),df(y,d.precedence,s),c.instance=y;case"stylesheet":k=bc(d.href);var T=s.querySelector(ih(k));if(T)return c.state.loading|=4,c.instance=T,ei(T),T;y=Ix(d),(k=Xr.get(k))&&ay(y,k),T=(s.ownerDocument||s).createElement("link"),ei(T);var j=T;return j._p=new Promise(function(X,ae){j.onload=X,j.onerror=ae}),Pi(T,"link",y),c.state.loading|=4,df(T,d.precedence,s),c.instance=T;case"script":return T=vc(d.src),(k=s.querySelector(rh(T)))?(c.instance=k,ei(k),k):(y=d,(k=Xr.get(T))&&(y=f({},d),oy(y,k)),s=s.ownerDocument||s,k=s.createElement("script"),ei(k),Pi(k,"link",y),s.head.appendChild(k),c.instance=k);case"void":return null;default:throw Error(i(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,df(y,d.precedence,s));return c.instance}function df(s,c,d){for(var y=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=y.length?y[y.length-1]:null,T=k,j=0;j<y.length;j++){var X=y[j];if(X.dataset.precedence===c)T=X;else if(T!==k)break}T?T.parentNode.insertBefore(s,T.nextSibling):(c=d.nodeType===9?d.head:d,c.insertBefore(s,c.firstChild))}function ay(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function oy(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var ff=null;function Bx(s,c,d){if(ff===null){var y=new Map,k=ff=new Map;k.set(d,y)}else k=ff,y=k.get(d),y||(y=new Map,k.set(d,y));if(y.has(s))return y;for(y.set(s,null),d=d.getElementsByTagName(s),k=0;k<d.length;k++){var T=d[k];if(!(T[Qi]||T[Mn]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var j=T.getAttribute(c)||"";j=s+j;var X=y.get(j);X?X.push(T):y.set(j,[T])}}return y}function zx(s,c,d){s=s.ownerDocument||s,s.head.insertBefore(d,c==="title"?s.querySelector("head > title"):null)}function AT(s,c,d){if(d===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function Px(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function TT(s,c,d,y){if(d.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var k=bc(y.href),T=c.querySelector(ih(k));if(T){c=T._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=pf.bind(s),c.then(s,s)),d.state.loading|=4,d.instance=T,ei(T);return}T=c.ownerDocument||c,y=Ix(y),(k=Xr.get(k))&&ay(y,k),T=T.createElement("link"),ei(T);var j=T;j._p=new Promise(function(X,ae){j.onload=X,j.onerror=ae}),Pi(T,"link",y),d.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(d,c),(c=d.state.preload)&&(d.state.loading&3)===0&&(s.count++,d=pf.bind(s),c.addEventListener("load",d),c.addEventListener("error",d))}}var ly=0;function MT(s,c){return s.stylesheets&&s.count===0&&gf(s,s.stylesheets),0<s.count||0<s.imgCount?function(d){var y=setTimeout(function(){if(s.stylesheets&&gf(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+c);0<s.imgBytes&&ly===0&&(ly=62500*cT());var k=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&gf(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>ly?50:800)+c);return s.unsuspend=d,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(k)}}:null}function pf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var mf=null;function gf(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,mf=new Map,c.forEach(RT,s),mf=null,pf.call(s))}function RT(s,c){if(!(c.state.loading&4)){var d=mf.get(s);if(d)var y=d.get(null);else{d=new Map,mf.set(s,d);for(var k=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<k.length;T++){var j=k[T];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(d.set(j.dataset.precedence,j),y=j)}y&&d.set(null,y)}k=c.instance,j=k.getAttribute("data-precedence"),T=d.get(j)||y,T===y&&d.set(null,k),d.set(j,k),this.count++,y=pf.bind(this),k.addEventListener("load",y),k.addEventListener("error",y),T?T.parentNode.insertBefore(k,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(k,s.firstChild)),c.state.loading|=4}}var sh={$$typeof:b,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function OT(s,c,d,y,k,T,j,X,ae){this.tag=1,this.containerInfo=s,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=_n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_n(0),this.hiddenUpdates=_n(null),this.identifierPrefix=y,this.onUncaughtError=k,this.onCaughtError=T,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}function Fx(s,c,d,y,k,T,j,X,ae,Ae,Le,je){return s=new OT(s,c,d,j,ae,Ae,Le,je,X),c=1,T===!0&&(c|=24),T=xr(3,null,null,c),s.current=T,T.stateNode=s,c=Um(),c.refCount++,s.pooledCache=c,c.refCount++,T.memoizedState={element:y,isDehydrated:d,cache:c},Wm(T),s}function jx(s){return s?(s=Zl,s):Zl}function Ux(s,c,d,y,k,T){k=jx(k),y.context===null?y.context=k:y.pendingContext=k,y=ao(c),y.payload={element:d},T=T===void 0?null:T,T!==null&&(y.callback=T),d=oo(s,y,c),d!==null&&(mr(d,s,c),zu(d,s,c))}function Hx(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<c?d:c}}function cy(s,c){Hx(s,c),(s=s.alternate)&&Hx(s,c)}function qx(s){if(s.tag===13||s.tag===31){var c=Rn(s,67108864);c!==null&&mr(c,s,67108864),cy(s,67108864)}}function Vx(s){if(s.tag===13||s.tag===31){var c=kr();c=Hn(c);var d=Rn(s,c);d!==null&&mr(d,s,c),cy(s,c)}}var yf=!0;function NT(s,c,d,y){var k=Z.T;Z.T=null;var T=ie.p;try{ie.p=2,uy(s,c,d,y)}finally{ie.p=T,Z.T=k}}function DT(s,c,d,y){var k=Z.T;Z.T=null;var T=ie.p;try{ie.p=8,uy(s,c,d,y)}finally{ie.p=T,Z.T=k}}function uy(s,c,d,y){if(yf){var k=hy(y);if(k===null)Xg(s,c,y,_f,d),$x(s,y);else if(LT(k,s,c,d,y))y.stopPropagation();else if($x(s,y),c&4&&-1<IT.indexOf(s)){for(;k!==null;){var T=En(k);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var j=ki(T.pendingLanes);if(j!==0){var X=T;for(X.pendingLanes|=2,X.entangledLanes|=2;j;){var ae=1<<31-et(j);X.entanglements[1]|=ae,j&=~ae}Fs(T),(An&6)===0&&(Qd=st()+500,Qu(0))}}break;case 31:case 13:X=Rn(T,2),X!==null&&mr(X,T,2),tf(),cy(T,2)}if(T=hy(y),T===null&&Xg(s,c,y,_f,d),T===k)break;k=T}k!==null&&y.stopPropagation()}else Xg(s,c,y,null,d)}}function hy(s){return s=qt(s),dy(s)}var _f=null;function dy(s){if(_f=null,s=xi(s),s!==null){var c=a(s);if(c===null)s=null;else{var d=c.tag;if(d===13){if(s=l(c),s!==null)return s;s=null}else if(d===31){if(s=o(c),s!==null)return s;s=null}else if(d===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return _f=s,null}function Wx(s){switch(s){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(kt()){case _e:return 2;case Ve:return 8;case ft:case Et:return 32;case Pt:return 268435456;default:return 32}default:return 32}}var fy=!1,bo=null,vo=null,xo=null,ah=new Map,oh=new Map,So=[],IT="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 $x(s,c){switch(s){case"focusin":case"focusout":bo=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":xo=null;break;case"pointerover":case"pointerout":ah.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":oh.delete(c.pointerId)}}function lh(s,c,d,y,k,T){return s===null||s.nativeEvent!==T?(s={blockedOn:c,domEventName:d,eventSystemFlags:y,nativeEvent:T,targetContainers:[k]},c!==null&&(c=En(c),c!==null&&qx(c)),s):(s.eventSystemFlags|=y,c=s.targetContainers,k!==null&&c.indexOf(k)===-1&&c.push(k),s)}function LT(s,c,d,y,k){switch(c){case"focusin":return bo=lh(bo,s,c,d,y,k),!0;case"dragenter":return vo=lh(vo,s,c,d,y,k),!0;case"mouseover":return xo=lh(xo,s,c,d,y,k),!0;case"pointerover":var T=k.pointerId;return ah.set(T,lh(ah.get(T)||null,s,c,d,y,k)),!0;case"gotpointercapture":return T=k.pointerId,oh.set(T,lh(oh.get(T)||null,s,c,d,y,k)),!0}return!1}function Gx(s){var c=xi(s.target);if(c!==null){var d=a(c);if(d!==null){if(c=d.tag,c===13){if(c=l(d),c!==null){s.blockedOn=c,ss(s.priority,function(){Vx(d)});return}}else if(c===31){if(c=o(d),c!==null){s.blockedOn=c,ss(s.priority,function(){Vx(d)});return}}else if(c===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function bf(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var d=hy(s.nativeEvent);if(d===null){d=s.nativeEvent;var y=new d.constructor(d.type,d);yt=y,d.target.dispatchEvent(y),yt=null}else return c=En(d),c!==null&&qx(c),s.blockedOn=d,!1;c.shift()}return!0}function Kx(s,c,d){bf(s)&&d.delete(c)}function BT(){fy=!1,bo!==null&&bf(bo)&&(bo=null),vo!==null&&bf(vo)&&(vo=null),xo!==null&&bf(xo)&&(xo=null),ah.forEach(Kx),oh.forEach(Kx)}function vf(s,c){s.blockedOn===c&&(s.blockedOn=null,fy||(fy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,BT)))}var xf=null;function Yx(s){xf!==s&&(xf=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){xf===s&&(xf=null);for(var c=0;c<s.length;c+=3){var d=s[c],y=s[c+1],k=s[c+2];if(typeof y!="function"){if(dy(y||d)===null)continue;break}var T=En(d);T!==null&&(s.splice(c,3),c-=3,hg(T,{pending:!0,data:k,method:d.method,action:y},y,k))}}))}function xc(s){function c(ae){return vf(ae,s)}bo!==null&&vf(bo,s),vo!==null&&vf(vo,s),xo!==null&&vf(xo,s),ah.forEach(c),oh.forEach(c);for(var d=0;d<So.length;d++){var y=So[d];y.blockedOn===s&&(y.blockedOn=null)}for(;0<So.length&&(d=So[0],d.blockedOn===null);)Gx(d),d.blockedOn===null&&So.shift();if(d=(s.ownerDocument||s).$$reactFormReplay,d!=null)for(y=0;y<d.length;y+=3){var k=d[y],T=d[y+1],j=k[Qn]||null;if(typeof T=="function")j||Yx(d);else if(j){var X=null;if(T&&T.hasAttribute("formAction")){if(k=T,j=T[Qn]||null)X=j.formAction;else if(dy(k)!==null)continue}else X=j.action;typeof X=="function"?d[y+1]=X:(d.splice(y,3),y-=3),Yx(d)}}}function Xx(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(j){return k=j})},focusReset:"manual",scroll:"manual"})}function c(){k!==null&&(k(),k=null),y||setTimeout(d,20)}function d(){if(!y&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,k=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(d,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),k!==null&&(k(),k=null)}}}function py(s){this._internalRoot=s}Sf.prototype.render=py.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(i(409));var d=c.current,y=kr();Ux(d,y,s,c,null,null)},Sf.prototype.unmount=py.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;Ux(s.current,2,null,s,null,null),tf(),c[Di]=null}};function Sf(s){this._internalRoot=s}Sf.prototype.unstable_scheduleHydration=function(s){if(s){var c=rs();s={blockedOn:null,target:s,priority:c};for(var d=0;d<So.length&&c!==0&&c<So[d].priority;d++);So.splice(d,0,s),d===0&&Gx(s)}};var Zx=e.version;if(Zx!=="19.2.4")throw Error(i(527,Zx,"19.2.4"));ie.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=h(c),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var zT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wf.isDisabled&&wf.supportsFiber)try{Pn=wf.inject(zT),Un=wf}catch{}}return uh.createRoot=function(s,c){if(!r(s))throw Error(i(299));var d=!1,y="",k=r1,T=s1,j=a1;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(k=c.onUncaughtError),c.onCaughtError!==void 0&&(T=c.onCaughtError),c.onRecoverableError!==void 0&&(j=c.onRecoverableError)),c=Fx(s,1,!1,null,null,d,y,null,k,T,j,Xx),s[Di]=c.current,Yg(s),new py(c)},uh.hydrateRoot=function(s,c,d){if(!r(s))throw Error(i(299));var y=!1,k="",T=r1,j=s1,X=a1,ae=null;return d!=null&&(d.unstable_strictMode===!0&&(y=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onUncaughtError!==void 0&&(T=d.onUncaughtError),d.onCaughtError!==void 0&&(j=d.onCaughtError),d.onRecoverableError!==void 0&&(X=d.onRecoverableError),d.formState!==void 0&&(ae=d.formState)),c=Fx(s,1,!0,c,d??null,y,k,ae,T,j,X,Xx),c.context=jx(null),d=c.current,y=kr(),y=Hn(y),k=ao(y),k.callback=null,oo(d,k,y),d=y,c.current.lanes=d,fn(c,d),Fs(c),s[Di]=c.current,Yg(s),new Sf(c)},uh.version="19.2.4",uh}var oS;function KT(){if(oS)return yy.exports;oS=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),yy.exports=GT(),yy.exports}var YT=KT();const XT="modulepreload",ZT=function(n){return"/"+n},lS={},ou=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let u=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=l?.nonce||l?.getAttribute("nonce");r=u(t.map(h=>{if(h=ZT(h),h in lS)return;lS[h]=!0;const p=h.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":XT,p||(m.as="script"),m.crossOrigin="",m.href=h,o&&m.setAttribute("nonce",o),document.head.appendChild(m),p)return new Promise((g,_)=>{m.addEventListener("load",g),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var cS="popstate";function uS(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function JT(n={}){function e(i,r){let a=r.state?.masked,{pathname:l,search:o,hash:u}=a||i.location;return K_("",{pathname:l,search:o,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default",a?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function t(i,r){return typeof r=="string"?r:Vh(r)}return eM(e,t,null,n)}function Zn(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function ns(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function QT(){return Math.random().toString(36).substring(2,10)}function hS(n,e){return{usr:n.state,key:n.key,idx:e,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function K_(n,e,t=null,i,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?lu(e):e,state:t,key:e&&e.key||i||QT(),unstable_mask:r}}function Vh({pathname:n="/",search:e="",hash:t=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(n+=t.charAt(0)==="#"?t:"#"+t),n}function lu(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substring(t),n=n.substring(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substring(i),n=n.substring(0,i)),n&&(e.pathname=n)}return e}function eM(n,e,t,i={}){let{window:r=document.defaultView,v5Compat:a=!1}=i,l=r.history,o="POP",u=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function f(){o="POP";let v=p(),x=v==null?null:v-h;h=v,u&&u({action:o,location:w.location,delta:x})}function m(v,x){o="PUSH";let S=uS(v)?v:K_(w.location,v,x);h=p()+1;let b=hS(S,h),C=w.createHref(S.unstable_mask||S);try{l.pushState(b,"",C)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(C)}a&&u&&u({action:o,location:w.location,delta:1})}function g(v,x){o="REPLACE";let S=uS(v)?v:K_(w.location,v,x);h=p();let b=hS(S,h),C=w.createHref(S.unstable_mask||S);l.replaceState(b,"",C),a&&u&&u({action:o,location:w.location,delta:0})}function _(v){return tM(v)}let w={get action(){return o},get location(){return n(r,l)},listen(v){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(cS,f),u=v,()=>{r.removeEventListener(cS,f),u=null}},createHref(v){return e(r,v)},createURL:_,encodeLocation(v){let x=_(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:g,go(v){return l.go(v)}};return w}function tM(n,e=!1){let t="http://localhost";typeof window<"u"&&(t=window.location.origin!=="null"?window.location.origin:window.location.href),Zn(t,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:Vh(n);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=t+i),new URL(i,t)}function _E(n,e,t="/"){return nM(n,e,t,!1)}function nM(n,e,t,i){let r=typeof e=="string"?lu(e):e,a=Ua(r.pathname||"/",t);if(a==null)return null;let l=bE(n);iM(l);let o=null;for(let u=0;o==null&&u<l.length;++u){let h=pM(a);o=dM(l[u],h,i)}return o}function bE(n,e=[],t=[],i="",r=!1){let a=(l,o,u=r,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(i)&&u)return;Zn(p.relativePath.startsWith(i),`Absolute route path "${p.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(i.length)}let f=Zs([i,p.relativePath]),m=t.concat(p);l.children&&l.children.length>0&&(Zn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),bE(l.children,e,m,f,u)),!(l.path==null&&!l.index)&&e.push({path:f,score:uM(f,l.index),routesMeta:m})};return n.forEach((l,o)=>{if(l.path===""||!l.path?.includes("?"))a(l,o);else for(let u of vE(l.path))a(l,o,!0,u)}),e}function vE(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),a=t.replace(/\?$/,"");if(i.length===0)return r?[a,""]:[a];let l=vE(i.join("/")),o=[];return o.push(...l.map(u=>u===""?a:[a,u].join("/"))),r&&o.push(...l),o.map(u=>n.startsWith("/")&&u===""?"/":u)}function iM(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:hM(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}var rM=/^:[\w-]+$/,sM=3,aM=2,oM=1,lM=10,cM=-2,dS=n=>n==="*";function uM(n,e){let t=n.split("/"),i=t.length;return t.some(dS)&&(i+=cM),e&&(i+=aM),t.filter(r=>!dS(r)).reduce((r,a)=>r+(rM.test(a)?sM:a===""?oM:lM),i)}function hM(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function dM(n,e,t=!1){let{routesMeta:i}=n,r={},a="/",l=[];for(let o=0;o<i.length;++o){let u=i[o],h=o===i.length-1,p=a==="/"?e:e.slice(a.length)||"/",f=Lp({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},p),m=u.route;if(!f&&h&&t&&!i[i.length-1].route.index&&(f=Lp({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(r,f.params),l.push({params:r,pathname:Zs([a,f.pathname]),pathnameBase:_M(Zs([a,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(a=Zs([a,f.pathnameBase]))}return l}function Lp(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=fM(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let a=r[0],l=a.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:i.reduce((h,{paramName:p,isOptional:f},m)=>{if(p==="*"){let _=o[m]||"";l=a.slice(0,a.length-_.length).replace(/(.)\/+$/,"$1")}const g=o[m];return f&&!g?h[p]=void 0:h[p]=(g||"").replace(/%2F/g,"/"),h},{}),pathname:a,pathnameBase:l,pattern:n}}function fM(n,e=!1,t=!0){ns(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,u,h,p)=>{if(i.push({paramName:o,isOptional:u!=null}),u){let f=p.charAt(h+l.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function pM(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ns(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function Ua(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}var mM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function gM(n,e="/"){let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?lu(n):n,a;return t?(t=t.replace(/\/\/+/g,"/"),t.startsWith("/")?a=fS(t.substring(1),"/"):a=fS(t,e)):a=e,{pathname:a,search:bM(i),hash:vM(r)}}function fS(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function xy(n,e,t,i){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yM(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function I0(n){let e=yM(n);return e.map((t,i)=>i===e.length-1?t.pathname:t.pathnameBase)}function om(n,e,t,i=!1){let r;typeof n=="string"?r=lu(n):(r={...n},Zn(!r.pathname||!r.pathname.includes("?"),xy("?","pathname","search",r)),Zn(!r.pathname||!r.pathname.includes("#"),xy("#","pathname","hash",r)),Zn(!r.search||!r.search.includes("#"),xy("#","search","hash",r)));let a=n===""||r.pathname==="",l=a?"/":r.pathname,o;if(l==null)o=t;else{let f=e.length-1;if(!i&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),f-=1;r.pathname=m.join("/")}o=f>=0?e[f]:"/"}let u=gM(r,o),h=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&t.endsWith("/");return!u.pathname.endsWith("/")&&(h||p)&&(u.pathname+="/"),u}var Zs=n=>n.join("/").replace(/\/\/+/g,"/"),_M=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),bM=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,vM=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,xM=class{constructor(n,e,t,i=!1){this.status=n,this.statusText=e||"",this.internal=i,t instanceof Error?(this.data=t.toString(),this.error=t):this.data=t}};function SM(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function wM(n){return n.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var xE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function SE(n,e){let t=n;if(typeof t!="string"||!mM.test(t))return{absoluteURL:void 0,isExternal:!1,to:t};let i=t,r=!1;if(xE)try{let a=new URL(window.location.href),l=t.startsWith("//")?new URL(a.protocol+t):new URL(t),o=Ua(l.pathname,e);l.origin===a.origin&&o!=null?t=o+l.search+l.hash:r=!0}catch{ns(!1,`<Link to="${t}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:t}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var wE=["POST","PUT","PATCH","DELETE"];new Set(wE);var CM=["GET",...wE];new Set(CM);var cu=V.createContext(null);cu.displayName="DataRouter";var lm=V.createContext(null);lm.displayName="DataRouterState";var EM=V.createContext(!1),CE=V.createContext({isTransitioning:!1});CE.displayName="ViewTransition";var kM=V.createContext(new Map);kM.displayName="Fetchers";var AM=V.createContext(null);AM.displayName="Await";var zr=V.createContext(null);zr.displayName="Navigation";var rd=V.createContext(null);rd.displayName="Location";var ws=V.createContext({outlet:null,matches:[],isDataRoute:!1});ws.displayName="Route";var L0=V.createContext(null);L0.displayName="RouteError";var EE="REACT_ROUTER_ERROR",TM="REDIRECT",MM="ROUTE_ERROR_RESPONSE";function RM(n){if(n.startsWith(`${EE}:${TM}:{`))try{let e=JSON.parse(n.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function OM(n){if(n.startsWith(`${EE}:${MM}:{`))try{let e=JSON.parse(n.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new xM(e.status,e.statusText,e.data)}catch{}}function NM(n,{relative:e}={}){Zn(uu(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:i}=V.useContext(zr),{hash:r,pathname:a,search:l}=sd(n,{relative:e}),o=a;return t!=="/"&&(o=a==="/"?t:Zs([t,a])),i.createHref({pathname:o,search:l,hash:r})}function uu(){return V.useContext(rd)!=null}function Qs(){return Zn(uu(),"useLocation() may be used only in the context of a <Router> component."),V.useContext(rd).location}var kE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function AE(n){V.useContext(zr).static||V.useLayoutEffect(n)}function B0(){let{isDataRoute:n}=V.useContext(ws);return n?GM():DM()}function DM(){Zn(uu(),"useNavigate() may be used only in the context of a <Router> component.");let n=V.useContext(cu),{basename:e,navigator:t}=V.useContext(zr),{matches:i}=V.useContext(ws),{pathname:r}=Qs(),a=JSON.stringify(I0(i)),l=V.useRef(!1);return AE(()=>{l.current=!0}),V.useCallback((u,h={})=>{if(ns(l.current,kE),!l.current)return;if(typeof u=="number"){t.go(u);return}let p=om(u,JSON.parse(a),r,h.relative==="path");n==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Zs([e,p.pathname])),(h.replace?t.replace:t.push)(p,h.state,h)},[e,t,a,r,n])}var IM=V.createContext(null);function LM(n){let e=V.useContext(ws).outlet;return V.useMemo(()=>e&&V.createElement(IM.Provider,{value:n},e),[e,n])}function sd(n,{relative:e}={}){let{matches:t}=V.useContext(ws),{pathname:i}=Qs(),r=JSON.stringify(I0(t));return V.useMemo(()=>om(n,JSON.parse(r),i,e==="path"),[n,r,i,e])}function BM(n,e){return TE(n,e)}function TE(n,e,t){Zn(uu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=V.useContext(zr),{matches:r}=V.useContext(ws),a=r[r.length-1],l=a?a.params:{},o=a?a.pathname:"/",u=a?a.pathnameBase:"/",h=a&&a.route;{let v=h&&h.path||"";RE(o,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${v}">) 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.
11
+
12
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let p=Qs(),f;if(e){let v=typeof e=="string"?lu(e):e;Zn(u==="/"||v.pathname?.startsWith(u),`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 "${u}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=p;let m=f.pathname||"/",g=m;if(u!=="/"){let v=u.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(v.length).join("/")}let _=_E(n,{pathname:g});ns(h||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ns(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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=UM(_&&_.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Zs([u,i.encodeLocation?i.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?u:Zs([u,i.encodeLocation?i.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),r,t);return e&&w?V.createElement(rd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},w):w}function zM(){let n=$M(),e=SM(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",n),l=V.createElement(V.Fragment,null,V.createElement("p",null,"💿 Hey developer 👋"),V.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",V.createElement("code",{style:a},"ErrorBoundary")," or"," ",V.createElement("code",{style:a},"errorElement")," prop on your route.")),V.createElement(V.Fragment,null,V.createElement("h2",null,"Unexpected Application Error!"),V.createElement("h3",{style:{fontStyle:"italic"}},e),t?V.createElement("pre",{style:r},t):null,l)}var PM=V.createElement(zM,null),ME=class extends V.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){this.props.onError?this.props.onError(n,e):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const t=OM(n.digest);t&&(n=t)}let e=n!==void 0?V.createElement(ws.Provider,{value:this.props.routeContext},V.createElement(L0.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?V.createElement(FM,{error:n},e):e}};ME.contextType=EM;var Sy=new WeakMap;function FM({children:n,error:e}){let{basename:t}=V.useContext(zr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=RM(e.digest);if(i){let r=Sy.get(e);if(r)throw r;let a=SE(i.location,t);if(xE&&!Sy.get(e))if(a.isExternal||i.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:i.replace}));throw Sy.set(e,l),l}return V.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return n}function jM({routeContext:n,match:e,children:t}){let i=V.useContext(cu);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),V.createElement(ws.Provider,{value:n},t)}function UM(n,e=[],t){let i=t?.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let r=n,a=i?.errors;if(a!=null){let p=r.findIndex(f=>f.route.id&&a?.[f.route.id]!==void 0);Zn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),r=r.slice(0,Math.min(r.length,p+1))}let l=!1,o=-1;if(t&&i){l=i.renderFallback;for(let p=0;p<r.length;p++){let f=r[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(o=p),f.route.id){let{loaderData:m,errors:g}=i,_=f.route.loader&&!m.hasOwnProperty(f.route.id)&&(!g||g[f.route.id]===void 0);if(f.route.lazy||_){t.isStatic&&(l=!0),o>=0?r=r.slice(0,o+1):r=[r[0]];break}}}}let u=t?.onError,h=i&&u?(p,f)=>{u(p,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:wM(i.matches),errorInfo:f})}:void 0;return r.reduceRight((p,f,m)=>{let g,_=!1,w=null,v=null;i&&(g=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||PM,l&&(o<0&&m===0?(RE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,v=null):o===m&&(_=!0,v=f.route.hydrateFallbackElement||null)));let x=e.concat(r.slice(0,m+1)),S=()=>{let b;return g?b=w:_?b=v:f.route.Component?b=V.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=p,V.createElement(jM,{match:f,routeContext:{outlet:p,matches:x,isDataRoute:i!=null},children:b})};return i&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?V.createElement(ME,{location:i.location,revalidation:i.revalidation,component:w,error:g,children:S(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:h}):S()},null)}function z0(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HM(n){let e=V.useContext(cu);return Zn(e,z0(n)),e}function qM(n){let e=V.useContext(lm);return Zn(e,z0(n)),e}function VM(n){let e=V.useContext(ws);return Zn(e,z0(n)),e}function P0(n){let e=VM(n),t=e.matches[e.matches.length-1];return Zn(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function WM(){return P0("useRouteId")}function $M(){let n=V.useContext(L0),e=qM("useRouteError"),t=P0("useRouteError");return n!==void 0?n:e.errors?.[t]}function GM(){let{router:n}=HM("useNavigate"),e=P0("useNavigate"),t=V.useRef(!1);return AE(()=>{t.current=!0}),V.useCallback(async(r,a={})=>{ns(t.current,kE),t.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:e,...a}))},[n,e])}var pS={};function RE(n,e,t){!e&&!pS[n]&&(pS[n]=!0,ns(!1,t))}V.memo(KM);function KM({routes:n,future:e,state:t,isStatic:i,onError:r}){return TE(n,void 0,{state:t,isStatic:i,onError:r})}function YM({to:n,replace:e,state:t,relative:i}){Zn(uu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=V.useContext(zr);ns(!r,"<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:a}=V.useContext(ws),{pathname:l}=Qs(),o=B0(),u=om(n,I0(a),l,i==="path"),h=JSON.stringify(u);return V.useEffect(()=>{o(JSON.parse(h),{replace:e,state:t,relative:i})},[o,h,i,e,t]),null}function XM(n){return LM(n.context)}function La(n){Zn(!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 ZM({basename:n="/",children:e=null,location:t,navigationType:i="POP",navigator:r,static:a=!1,unstable_useTransitions:l}){Zn(!uu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=n.replace(/^\/*/,"/"),u=V.useMemo(()=>({basename:o,navigator:r,static:a,unstable_useTransitions:l,future:{}}),[o,r,a,l]);typeof t=="string"&&(t=lu(t));let{pathname:h="/",search:p="",hash:f="",state:m=null,key:g="default",unstable_mask:_}=t,w=V.useMemo(()=>{let v=Ua(h,o);return v==null?null:{location:{pathname:v,search:p,hash:f,state:m,key:g,unstable_mask:_},navigationType:i}},[o,h,p,f,m,g,i,_]);return ns(w!=null,`<Router basename="${o}"> is not able to match the URL "${h}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:V.createElement(zr.Provider,{value:u},V.createElement(rd.Provider,{children:e,value:w}))}function JM({children:n,location:e}){return BM(Y_(n),e)}function Y_(n,e=[]){let t=[];return V.Children.forEach(n,(i,r)=>{if(!V.isValidElement(i))return;let a=[...e,r];if(i.type===V.Fragment){t.push.apply(t,Y_(i.props.children,a));return}Zn(i.type===La,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Zn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||a.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Y_(i.props.children,a)),t.push(l)}),t}var Ap="get",Tp="application/x-www-form-urlencoded";function cm(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function QM(n){return cm(n)&&n.tagName.toLowerCase()==="button"}function eR(n){return cm(n)&&n.tagName.toLowerCase()==="form"}function tR(n){return cm(n)&&n.tagName.toLowerCase()==="input"}function nR(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function iR(n,e){return n.button===0&&(!e||e==="_self")&&!nR(n)}function X_(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let i=n[t];return e.concat(Array.isArray(i)?i.map(r=>[t,r]):[[t,i]])},[]))}function rR(n,e){let t=X_(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(a=>{t.append(r,a)})}),t}var Cf=null;function sR(){if(Cf===null)try{new FormData(document.createElement("form"),0),Cf=!1}catch{Cf=!0}return Cf}var aR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wy(n){return n!=null&&!aR.has(n)?(ns(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tp}"`),null):n}function oR(n,e){let t,i,r,a,l;if(eR(n)){let o=n.getAttribute("action");i=o?Ua(o,e):null,t=n.getAttribute("method")||Ap,r=wy(n.getAttribute("enctype"))||Tp,a=new FormData(n)}else if(QM(n)||tR(n)&&(n.type==="submit"||n.type==="image")){let o=n.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=n.getAttribute("formaction")||o.getAttribute("action");if(i=u?Ua(u,e):null,t=n.getAttribute("formmethod")||o.getAttribute("method")||Ap,r=wy(n.getAttribute("formenctype"))||wy(o.getAttribute("enctype"))||Tp,a=new FormData(o,n),!sR()){let{name:h,type:p,value:f}=n;if(p==="image"){let m=h?`${h}.`:"";a.append(`${m}x`,"0"),a.append(`${m}y`,"0")}else h&&a.append(h,f)}}else{if(cm(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=Ap,i=null,r=Tp,l=n}return a&&r==="text/plain"&&(l=a,a=void 0),{action:i,method:t.toLowerCase(),encType:r,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function F0(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function lR(n,e,t,i){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return t?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&Ua(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function cR(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uR(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function hR(n,e,t){let i=await Promise.all(n.map(async r=>{let a=e.routes[r.route.id];if(a){let l=await cR(a,t);return l.links?l.links():[]}return[]}));return mR(i.flat(1).filter(uR).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function mS(n,e,t,i,r,a){let l=(u,h)=>t[h]?u.route.id!==t[h].route.id:!0,o=(u,h)=>t[h].pathname!==u.pathname||t[h].route.path?.endsWith("*")&&t[h].params["*"]!==u.params["*"];return a==="assets"?e.filter((u,h)=>l(u,h)||o(u,h)):a==="data"?e.filter((u,h)=>{let p=i.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(l(u,h)||o(u,h))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:t[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function dR(n,e,{includeHydrateFallback:t}={}){return fR(n.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))}function fR(n){return[...new Set(n)]}function pR(n){let e={},t=Object.keys(n).sort();for(let i of t)e[i]=n[i];return e}function mR(n,e){let t=new Set;return new Set(e),n.reduce((i,r)=>{let a=JSON.stringify(pR(r));return t.has(a)||(t.add(a),i.push({key:a,link:r})),i},[])}function OE(){let n=V.useContext(cu);return F0(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function gR(){let n=V.useContext(lm);return F0(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var j0=V.createContext(void 0);j0.displayName="FrameworkContext";function NE(){let n=V.useContext(j0);return F0(n,"You must render this element inside a <HydratedRouter> element"),n}function yR(n,e){let t=V.useContext(j0),[i,r]=V.useState(!1),[a,l]=V.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:h,onMouseLeave:p,onTouchStart:f}=e,m=V.useRef(null);V.useEffect(()=>{if(n==="render"&&l(!0),n==="viewport"){let w=x=>{x.forEach(S=>{l(S.isIntersecting)})},v=new IntersectionObserver(w,{threshold:.5});return m.current&&v.observe(m.current),()=>{v.disconnect()}}},[n]),V.useEffect(()=>{if(i){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[i]);let g=()=>{r(!0)},_=()=>{r(!1),l(!1)};return t?n!=="intent"?[a,m,{}]:[a,m,{onFocus:hh(o,g),onBlur:hh(u,_),onMouseEnter:hh(h,g),onMouseLeave:hh(p,_),onTouchStart:hh(f,g)}]:[!1,m,{}]}function hh(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function _R({page:n,...e}){let{router:t}=OE(),i=V.useMemo(()=>_E(t.routes,n,t.basename),[t.routes,n,t.basename]);return i?V.createElement(vR,{page:n,matches:i,...e}):null}function bR(n){let{manifest:e,routeModules:t}=NE(),[i,r]=V.useState([]);return V.useEffect(()=>{let a=!1;return hR(n,e,t).then(l=>{a||r(l)}),()=>{a=!0}},[n,e,t]),i}function vR({page:n,matches:e,...t}){let i=Qs(),{future:r,manifest:a,routeModules:l}=NE(),{basename:o}=OE(),{loaderData:u,matches:h}=gR(),p=V.useMemo(()=>mS(n,e,h,a,i,"data"),[n,e,h,a,i]),f=V.useMemo(()=>mS(n,e,h,a,i,"assets"),[n,e,h,a,i]),m=V.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let w=new Set,v=!1;if(e.forEach(S=>{let b=a.routes[S.route.id];!b||!b.hasLoader||(!p.some(C=>C.route.id===S.route.id)&&S.route.id in u&&l[S.route.id]?.shouldRevalidate||b.hasClientLoader?v=!0:w.add(S.route.id))}),w.size===0)return[];let x=lR(n,o,r.unstable_trailingSlashAwareDataRequests,"data");return v&&w.size>0&&x.searchParams.set("_routes",e.filter(S=>w.has(S.route.id)).map(S=>S.route.id).join(",")),[x.pathname+x.search]},[o,r.unstable_trailingSlashAwareDataRequests,u,i,a,p,e,n,l]),g=V.useMemo(()=>dR(f,a),[f,a]),_=bR(f);return V.createElement(V.Fragment,null,m.map(w=>V.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...t})),g.map(w=>V.createElement("link",{key:w,rel:"modulepreload",href:w,...t})),_.map(({key:w,link:v})=>V.createElement("link",{key:w,nonce:t.nonce,...v,crossOrigin:v.crossOrigin??t.crossOrigin})))}function xR(...n){return e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var SR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{SR&&(window.__reactRouterVersion="7.13.1")}catch{}function wR({basename:n,children:e,unstable_useTransitions:t,window:i}){let r=V.useRef();r.current==null&&(r.current=JT({window:i,v5Compat:!0}));let a=r.current,[l,o]=V.useState({action:a.action,location:a.location}),u=V.useCallback(h=>{t===!1?o(h):V.startTransition(()=>o(h))},[t]);return V.useLayoutEffect(()=>a.listen(u),[a,u]),V.createElement(ZM,{basename:n,children:e,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:t})}var DE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,IE=V.forwardRef(function({onClick:e,discover:t="render",prefetch:i="none",relative:r,reloadDocument:a,replace:l,unstable_mask:o,state:u,target:h,to:p,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:g,..._},w){let{basename:v,navigator:x,unstable_useTransitions:S}=V.useContext(zr),b=typeof p=="string"&&DE.test(p),C=SE(p,v);p=C.to;let O=NM(p,{relative:r}),M=Qs(),D=null;if(o){let Q=om(o,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);v!=="/"&&(Q.pathname=Q.pathname==="/"?v:Zs([v,Q.pathname])),D=x.createHref(Q)}let[N,B,U]=yR(i,_),Y=kR(p,{replace:l,unstable_mask:o,state:u,target:h,preventScrollReset:f,relative:r,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:S});function K(Q){e&&e(Q),Q.defaultPrevented||Y(Q)}let H=!(C.isExternal||a),J=V.createElement("a",{..._,...U,href:(H?D:void 0)||C.absoluteURL||O,onClick:H?K:e,ref:xR(w,B),target:h,"data-discover":!b&&t==="render"?"true":void 0});return N&&!b?V.createElement(V.Fragment,null,J,V.createElement(_R,{page:O})):J});IE.displayName="Link";var LE=V.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:i="",end:r=!1,style:a,to:l,viewTransition:o,children:u,...h},p){let f=sd(l,{relative:h.relative}),m=Qs(),g=V.useContext(lm),{navigator:_,basename:w}=V.useContext(zr),v=g!=null&&OR(f)&&o===!0,x=_.encodeLocation?_.encodeLocation(f).pathname:f.pathname,S=m.pathname,b=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;t||(S=S.toLowerCase(),b=b?b.toLowerCase():null,x=x.toLowerCase()),b&&w&&(b=Ua(b,w)||b);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let O=S===x||!r&&S.startsWith(x)&&S.charAt(C)==="/",M=b!=null&&(b===x||!r&&b.startsWith(x)&&b.charAt(x.length)==="/"),D={isActive:O,isPending:M,isTransitioning:v},N=O?e:void 0,B;typeof i=="function"?B=i(D):B=[i,O?"active":null,M?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let U=typeof a=="function"?a(D):a;return V.createElement(IE,{...h,"aria-current":N,className:B,ref:p,style:U,to:l,viewTransition:o},typeof u=="function"?u(D):u)});LE.displayName="NavLink";var CR=V.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:i,replace:r,state:a,method:l=Ap,action:o,onSubmit:u,relative:h,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:m,...g},_)=>{let{unstable_useTransitions:w}=V.useContext(zr),v=MR(),x=RR(o,{relative:h}),S=l.toLowerCase()==="get"?"get":"post",b=typeof o=="string"&&DE.test(o),C=O=>{if(u&&u(O),O.defaultPrevented)return;O.preventDefault();let M=O.nativeEvent.submitter,D=M?.getAttribute("formmethod")||l,N=()=>v(M||O.currentTarget,{fetcherKey:e,method:D,navigate:t,replace:r,state:a,relative:h,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:m});w&&t!==!1?V.startTransition(()=>N()):N()};return V.createElement("form",{ref:_,method:S,action:x,onSubmit:i?u:C,...g,"data-discover":!b&&n==="render"?"true":void 0})});CR.displayName="Form";function ER(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function BE(n){let e=V.useContext(cu);return Zn(e,ER(n)),e}function kR(n,{target:e,replace:t,unstable_mask:i,state:r,preventScrollReset:a,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:u,unstable_useTransitions:h}={}){let p=B0(),f=Qs(),m=sd(n,{relative:l});return V.useCallback(g=>{if(iR(g,e)){g.preventDefault();let _=t!==void 0?t:Vh(f)===Vh(m),w=()=>p(n,{replace:_,unstable_mask:i,state:r,preventScrollReset:a,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:u});h?V.startTransition(()=>w()):w()}},[f,p,m,t,i,r,e,n,a,l,o,u,h])}function x$(n){ns(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=V.useRef(X_(n)),t=V.useRef(!1),i=Qs(),r=V.useMemo(()=>rR(i.search,t.current?null:e.current),[i.search]),a=B0(),l=V.useCallback((o,u)=>{const h=X_(typeof o=="function"?o(new URLSearchParams(r)):o);t.current=!0,a("?"+h,u)},[a,r]);return[r,l]}var AR=0,TR=()=>`__${String(++AR)}__`;function MR(){let{router:n}=BE("useSubmit"),{basename:e}=V.useContext(zr),t=WM(),i=n.fetch,r=n.navigate;return V.useCallback(async(a,l={})=>{let{action:o,method:u,encType:h,formData:p,body:f}=oR(a,e);if(l.navigate===!1){let m=l.fetcherKey||TR();await i(m,t,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:f,formMethod:l.method||u,formEncType:l.encType||h,flushSync:l.flushSync})}else await r(l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:f,formMethod:l.method||u,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:t,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,t])}function RR(n,{relative:e}={}){let{basename:t}=V.useContext(zr),i=V.useContext(ws);Zn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),a={...sd(n||".",{relative:e})},l=Qs();if(n==null){a.search=l.search;let o=new URLSearchParams(a.search),u=o.getAll("index");if(u.some(p=>p==="")){o.delete("index"),u.filter(f=>f).forEach(f=>o.append("index",f));let p=o.toString();a.search=p?`?${p}`:""}}return(!n||n===".")&&r.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:Zs([t,a.pathname])),Vh(a)}function OR(n,{relative:e}={}){let t=V.useContext(CE);Zn(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=BE("useViewTransitionState"),r=sd(n,{relative:e});if(!t.isTransitioning)return!1;let a=Ua(t.currentLocation.pathname,i)||t.currentLocation.pathname,l=Ua(t.nextLocation.pathname,i)||t.nextLocation.pathname;return Lp(r.pathname,l)!=null||Lp(r.pathname,a)!=null}var um=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},NR={setTimeout:(n,e)=>setTimeout(n,e),clearTimeout:n=>clearTimeout(n),setInterval:(n,e)=>setInterval(n,e),clearInterval:n=>clearInterval(n)},DR=class{#e=NR;#n=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,e){return this.#e.setTimeout(n,e)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,e){return this.#e.setInterval(n,e)}clearInterval(n){this.#e.clearInterval(n)}},Z_=new DR;function IR(n){setTimeout(n,0)}var hm=typeof window>"u"||"Deno"in globalThis;function _s(){}function LR(n,e){return typeof n=="function"?n(e):n}function BR(n){return typeof n=="number"&&n>=0&&n!==1/0}function zR(n,e){return Math.max(n+(e||0)-Date.now(),0)}function J_(n,e){return typeof n=="function"?n(e):n}function PR(n,e){return typeof n=="function"?n(e):n}function gS(n,e){const{type:t="all",exact:i,fetchStatus:r,predicate:a,queryKey:l,stale:o}=n;if(l){if(i){if(e.queryHash!==U0(l,e.options))return!1}else if(!$h(e.queryKey,l))return!1}if(t!=="all"){const u=e.isActive();if(t==="active"&&!u||t==="inactive"&&u)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||r&&r!==e.state.fetchStatus||a&&!a(e))}function yS(n,e){const{exact:t,status:i,predicate:r,mutationKey:a}=n;if(a){if(!e.options.mutationKey)return!1;if(t){if(Wh(e.options.mutationKey)!==Wh(a))return!1}else if(!$h(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function U0(n,e){return(e?.queryKeyHashFn||Wh)(n)}function Wh(n){return JSON.stringify(n,(e,t)=>Q_(t)?Object.keys(t).sort().reduce((i,r)=>(i[r]=t[r],i),{}):t)}function $h(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>$h(n[t],e[t])):!1}var FR=Object.prototype.hasOwnProperty;function zE(n,e,t=0){if(n===e)return n;if(t>500)return e;const i=_S(n)&&_S(e);if(!i&&!(Q_(n)&&Q_(e)))return e;const a=(i?n:Object.keys(n)).length,l=i?e:Object.keys(e),o=l.length,u=i?new Array(o):{};let h=0;for(let p=0;p<o;p++){const f=i?p:l[p],m=n[f],g=e[f];if(m===g){u[f]=m,(i?p<a:FR.call(n,f))&&h++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[f]=g;continue}const _=zE(m,g,t+1);u[f]=_,_===m&&h++}return a===o&&h===a?n:u}function S$(n,e){if(!e||Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function _S(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Q_(n){if(!bS(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!bS(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function bS(n){return Object.prototype.toString.call(n)==="[object Object]"}function jR(n){return new Promise(e=>{Z_.setTimeout(e,n)})}function UR(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?zE(n,e):e}function HR(n,e,t=0){const i=[...n,e];return t&&i.length>t?i.slice(1):i}function qR(n,e,t=0){const i=[e,...n];return t&&i.length>t?i.slice(0,-1):i}var H0=Symbol();function PE(n,e){return!n.queryFn&&e?.initialPromise?()=>e.initialPromise:!n.queryFn||n.queryFn===H0?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function w$(n,e){return typeof n=="function"?n(...e):!!n}function VR(n,e,t){let i=!1,r;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?t():r.addEventListener("abort",t,{once:!0})),r)}),n}var WR=class extends um{#e;#n;#t;constructor(){super(),this.#t=n=>{if(!hm&&window.addEventListener){const e=()=>n();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(n){this.#t=n,this.#n?.(),this.#n=n(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(e=>{e(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},FE=new WR;function $R(){let n,e;const t=new Promise((r,a)=>{n=r,e=a});t.status="pending",t.catch(()=>{});function i(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{i({status:"fulfilled",value:r}),n(r)},t.reject=r=>{i({status:"rejected",reason:r}),e(r)},t}var GR=IR;function KR(){let n=[],e=0,t=o=>{o()},i=o=>{o()},r=GR;const a=o=>{e?n.push(o):r(()=>{t(o)})},l=()=>{const o=n;n=[],o.length&&r(()=>{i(()=>{o.forEach(u=>{t(u)})})})};return{batch:o=>{let u;e++;try{u=o()}finally{e--,e||l()}return u},batchCalls:o=>(...u)=>{a(()=>{o(...u)})},schedule:a,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{i=o},setScheduler:o=>{r=o}}}var rr=KR(),YR=class extends um{#e=!0;#n;#t;constructor(){super(),this.#t=n=>{if(!hm&&window.addEventListener){const e=()=>n(!0),t=()=>n(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(n){this.#t=n,this.#n?.(),this.#n=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(t=>{t(n)}))}isOnline(){return this.#e}},Bp=new YR;function XR(n){return Math.min(1e3*2**n,3e4)}function jE(n){return(n??"online")==="online"?Bp.isOnline():!0}var e0=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function UE(n){let e=!1,t=0,i;const r=$R(),a=()=>r.status!=="pending",l=w=>{if(!a()){const v=new e0(w);m(v),n.onCancel?.(v)}},o=()=>{e=!0},u=()=>{e=!1},h=()=>FE.isFocused()&&(n.networkMode==="always"||Bp.isOnline())&&n.canRun(),p=()=>jE(n.networkMode)&&n.canRun(),f=w=>{a()||(i?.(),r.resolve(w))},m=w=>{a()||(i?.(),r.reject(w))},g=()=>new Promise(w=>{i=v=>{(a()||h())&&w(v)},n.onPause?.()}).then(()=>{i=void 0,a()||n.onContinue?.()}),_=()=>{if(a())return;let w;const v=t===0?n.initialPromise:void 0;try{w=v??n.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(f).catch(x=>{if(a())return;const S=n.retry??(hm?0:3),b=n.retryDelay??XR,C=typeof b=="function"?b(t,x):b,O=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,x);if(e||!O){m(x);return}t++,n.onFail?.(t,x),jR(C).then(()=>h()?void 0:g()).then(()=>{e?m(x):_()})})};return{promise:r,status:()=>r.status,cancel:l,continue:()=>(i?.(),r),cancelRetry:o,continueRetry:u,canStart:p,start:()=>(p()?_():g().then(_),r)}}var HE=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),BR(this.gcTime)&&(this.#e=Z_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(hm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Z_.clearTimeout(this.#e),this.#e=void 0)}},ZR=class extends HE{#e;#n;#t;#r;#i;#a;#o;constructor(n){super(),this.#o=!1,this.#a=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#r=n.client,this.#t=this.#r.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=xS(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(n){if(this.options={...this.#a,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=xS(this.options);e.data!==void 0&&(this.setState(vS(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(n,e){const t=UR(this.state.data,n,this.options);return this.#s({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(n,e){this.#s({type:"setState",state:n,setStateOptions:e})}cancel(n){const e=this.#i?.promise;return this.#i?.cancel(n),e?e.then(_s).catch(_s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>PR(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===H0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>J_(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!zR(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(e=>e!==n),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(n,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const o=this.observers.find(u=>u.options.queryFn);o&&this.setOptions(o.options)}const t=new AbortController,i=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,t.signal)})},r=()=>{const o=PE(this.options,e),h=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(p),p})();return this.#o=!1,this.options.persister?this.options.persister(o,h,this):o(h)},l=(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:r};return i(o),o})();this.options.behavior?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=UE({initialPromise:e?.initialPromise,fn:l.fetchFn,onCancel:o=>{o instanceof e0&&o.revert&&this.setState({...this.#n,fetchStatus:"idle"}),t.abort()},onFail:(o,u)=>{this.#s({type:"failed",failureCount:o,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const o=await this.#i.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#t.config.onSuccess?.(o,this),this.#t.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof e0){if(o.silent)return this.#i.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#s({type:"error",error:o}),this.#t.config.onError?.(o,this),this.#t.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#s(n){const e=t=>{switch(n.type){case"failed":return{...t,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...JR(t.data,this.options),fetchMeta:n.meta??null};case"success":const i={...t,...vS(n.data,n.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?i:void 0,i;case"error":const r=n.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...n.state}}};this.state=e(this.state),rr.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:n})})}};function JR(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jE(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function vS(n,e){return{data:n,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xS(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,i=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}function SS(n){return{onFetch:(e,t)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],l=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},u=0;const h=async()=>{let p=!1;const f=_=>{VR(_,()=>e.signal,()=>p=!0)},m=PE(e.options,e.fetchOptions),g=async(_,w,v)=>{if(p)return Promise.reject();if(w==null&&_.pages.length)return Promise.resolve(_);const S=(()=>{const M={client:e.client,queryKey:e.queryKey,pageParam:w,direction:v?"backward":"forward",meta:e.options.meta};return f(M),M})(),b=await m(S),{maxPages:C}=e.options,O=v?qR:HR;return{pages:O(_.pages,b,C),pageParams:O(_.pageParams,w,C)}};if(r&&a.length){const _=r==="backward",w=_?QR:wS,v={pages:a,pageParams:l},x=w(i,v);o=await g(v,x,_)}else{const _=n??a.length;do{const w=u===0?l[0]??i.initialPageParam:wS(i,o);if(u>0&&w==null)break;o=await g(o,w),u++}while(u<_)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=h}}}function wS(n,{pages:e,pageParams:t}){const i=e.length-1;return e.length>0?n.getNextPageParam(e[i],e,t[i],t):void 0}function QR(n,{pages:e,pageParams:t}){return e.length>0?n.getPreviousPageParam?.(e[0],e,t[0],t):void 0}var eO=class extends HE{#e;#n;#t;#r;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#t=n.mutationCache,this.#n=[],this.state=n.state||tO(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#n.includes(n)||(this.#n.push(n),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#n=this.#n.filter(e=>e!==n),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(n){const e=()=>{this.#i({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=UE({fn:()=>this.options.mutationFn?this.options.mutationFn(n,t):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const i=this.state.status==="pending",r=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:n,isPaused:r}),this.#t.config.onMutate&&await this.#t.config.onMutate(n,this,t);const l=await this.options.onMutate?.(n,t);l!==this.state.context&&this.#i({type:"pending",context:l,variables:n,isPaused:r})}const a=await this.#r.start();return await this.#t.config.onSuccess?.(a,n,this.state.context,this,t),await this.options.onSuccess?.(a,n,this.state.context,t),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(a,null,n,this.state.context,t),this.#i({type:"success",data:a}),a}catch(a){try{await this.#t.config.onError?.(a,n,this.state.context,this,t)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,n,this.state.context,t)}catch(l){Promise.reject(l)}try{await this.#t.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,t)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,n,this.state.context,t)}catch(l){Promise.reject(l)}throw this.#i({type:"error",error:a}),a}finally{this.#t.runNext(this)}}#i(n){const e=t=>{switch(n.type){case"failed":return{...t,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...t,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:n.error,failureCount:t.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=e(this.state),rr.batch(()=>{this.#n.forEach(t=>{t.onMutationUpdate(n)}),this.#t.notify({mutation:this,type:"updated",action:n})})}};function tO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nO=class extends um{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(n,e,t){const i=new eO({client:n,mutationCache:this,mutationId:++this.#t,options:n.defaultMutationOptions(e),state:t});return this.add(i),i}add(n){this.#e.add(n);const e=Ef(n);if(typeof e=="string"){const t=this.#n.get(e);t?t.push(n):this.#n.set(e,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const e=Ef(n);if(typeof e=="string"){const t=this.#n.get(e);if(t)if(t.length>1){const i=t.indexOf(n);i!==-1&&t.splice(i,1)}else t[0]===n&&this.#n.delete(e)}}this.notify({type:"removed",mutation:n})}canRun(n){const e=Ef(n);if(typeof e=="string"){const i=this.#n.get(e)?.find(r=>r.state.status==="pending");return!i||i===n}else return!0}runNext(n){const e=Ef(n);return typeof e=="string"?this.#n.get(e)?.find(i=>i!==n&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){rr.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(n){const e={exact:!0,...n};return this.getAll().find(t=>yS(e,t))}findAll(n={}){return this.getAll().filter(e=>yS(n,e))}notify(n){rr.batch(()=>{this.listeners.forEach(e=>{e(n)})})}resumePausedMutations(){const n=this.getAll().filter(e=>e.state.isPaused);return rr.batch(()=>Promise.all(n.map(e=>e.continue().catch(_s))))}};function Ef(n){return n.options.scope?.id}var iO=class extends um{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,e,t){const i=e.queryKey,r=e.queryHash??U0(i,e);let a=this.get(r);return a||(a=new ZR({client:n,queryKey:i,queryHash:r,options:n.defaultQueryOptions(e),state:t,defaultOptions:n.getQueryDefaults(i)}),this.add(a)),a}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const e=this.#e.get(n.queryHash);e&&(n.destroy(),e===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){rr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const e={exact:!0,...n};return this.getAll().find(t=>gS(e,t))}findAll(n={}){const e=this.getAll();return Object.keys(n).length>0?e.filter(t=>gS(n,t)):e}notify(n){rr.batch(()=>{this.listeners.forEach(e=>{e(n)})})}onFocus(){rr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){rr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},rO=class{#e;#n;#t;#r;#i;#a;#o;#s;constructor(n={}){this.#e=n.queryCache||new iO,this.#n=n.mutationCache||new nO,this.#t=n.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FE.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Bp.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#n.findAll({...n,status:"pending"}).length}getQueryData(n){const e=this.defaultQueryOptions({queryKey:n});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=this.#e.build(this,e),i=t.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(J_(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:e,state:t})=>{const i=t.data;return[e,i]})}setQueryData(n,e,t){const i=this.defaultQueryOptions({queryKey:n}),a=this.#e.get(i.queryHash)?.state.data,l=LR(e,a);if(l!==void 0)return this.#e.build(this,i).setData(l,{...t,manual:!0})}setQueriesData(n,e,t){return rr.batch(()=>this.#e.findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,e,t)]))}getQueryState(n){const e=this.defaultQueryOptions({queryKey:n});return this.#e.get(e.queryHash)?.state}removeQueries(n){const e=this.#e;rr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=this.#e;return rr.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},i=rr.batch(()=>this.#e.findAll(n).map(r=>r.cancel(t)));return Promise.all(i).then(_s).catch(_s)}invalidateQueries(n,e={}){return rr.batch(()=>(this.#e.findAll(n).forEach(t=>{t.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},i=rr.batch(()=>this.#e.findAll(n).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,t);return t.throwOnError||(a=a.catch(_s)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(_s)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=this.#e.build(this,e);return t.isStaleByTime(J_(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(_s).catch(_s)}fetchInfiniteQuery(n){return n.behavior=SS(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(_s).catch(_s)}ensureInfiniteQueryData(n){return n.behavior=SS(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Bp.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(n){this.#t=n}setQueryDefaults(n,e){this.#r.set(Wh(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...this.#r.values()],t={};return e.forEach(i=>{$h(n,i.queryKey)&&Object.assign(t,i.defaultOptions)}),t}setMutationDefaults(n,e){this.#i.set(Wh(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...this.#i.values()],t={};return e.forEach(i=>{$h(n,i.mutationKey)&&Object.assign(t,i.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...this.#t.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=U0(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===H0&&(e.enabled=!1),e}defaultMutationOptions(n){return n?._defaulted?n:{...this.#t.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},qE=V.createContext(void 0),C$=n=>{const e=V.useContext(qE);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},sO=({client:n,children:e})=>(V.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),A.jsx(qE.Provider,{value:n,children:e}));const q0="auth_token",aO=300*1e3;function Bh(){try{return localStorage.getItem(q0)}catch{return null}}function VE(n){try{localStorage.setItem(q0,n)}catch{}}function Cy(){try{localStorage.removeItem(q0)}catch{}}function E$(n,e){const t=Bh();if(t){const i=new Headers(e?.headers);return i.has("Authorization")||i.set("Authorization",`Bearer ${t}`),fetch(n,{...e,headers:i})}return fetch(n,e)}async function oO(){try{const n=Bh();if(!n)return null;const e=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}}),t=await e.json();return e.ok&&t.success&&t.token?(VE(t.token),t.token):null}catch{return null}}function lO(){const[n,e]=V.useState({token:Bh(),loading:!0,needsLogin:!1}),t=V.useRef(null),i=V.useCallback(l=>{t.current&&clearTimeout(t.current);const o=Math.max(l*1e3-aO,3e4);t.current=setTimeout(async()=>{const u=await oO();u?(e(h=>({...h,token:u})),i(3600)):(Cy(),e({token:null,loading:!1,needsLogin:!0}))},o)},[]);V.useEffect(()=>{let l=!1;async function o(){try{const p=await(await fetch("/api/auth/status")).json();if(l)return;!p.passwordRequired||p.authenticated?(e({token:Bh(),loading:!1,needsLogin:!1}),p.passwordRequired&&p.authenticated&&Bh()&&i(3600)):e({token:null,loading:!1,needsLogin:!0})}catch{l||e({token:null,loading:!1,needsLogin:!0})}}o();function u(){t.current&&clearTimeout(t.current),Cy(),e({token:null,loading:!1,needsLogin:!0})}return document.addEventListener("ws-auth-failed",u),()=>{l=!0,t.current&&clearTimeout(t.current),document.removeEventListener("ws-auth-failed",u)}},[i]);const r=V.useCallback(async l=>{try{const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:l})}),u=await o.json();return o.ok&&u.success?(u.token&&VE(u.token),e({token:u.token??null,loading:!1,needsLogin:!1}),u.expiresIn&&i(u.expiresIn),{success:!0}):{success:!1,error:u.error||"Authentication failed"}}catch{return{success:!1,error:"Connection error -- is the server running?"}}},[i]),a=V.useCallback(()=>{t.current&&clearTimeout(t.current),Cy(),fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),e({token:null,loading:!1,needsLogin:!0})},[]);return{...n,login:r,logout:a}}const cO=1e3,uO=1e4;class V0{ws=null;options;reconnectAttempt=0;reconnectTimer=null;disposed=!1;lastSeq=0;constructor(e){this.options=e}connect(){if(this.disposed)return;const e=new URL(this.options.url,window.location.origin);e.protocol=e.protocol==="https:"?"wss:":"ws:",this.options.token&&e.searchParams.set("token",this.options.token),this.ws=new WebSocket(e.toString()),this.ws.onopen=()=>{this.reconnectAttempt=0,this.options.onStatus("connected"),this.lastSeq>0&&this.send({type:"replay",sinceSeq:this.lastSeq})},this.ws.onmessage=t=>{try{const i=JSON.parse(t.data);i.type==="snapshot"&&"seq"in i&&(this.lastSeq=i.seq),this.options.onMessage(i)}catch{}},this.ws.onclose=t=>{if(!this.disposed){if(t.code===4001){this.options.onStatus("disconnected"),document.dispatchEvent(new CustomEvent("ws-auth-failed"));return}this.options.onStatus("reconnecting"),this.scheduleReconnect()}},this.ws.onerror=()=>{}}static MAX_BUFFERED=64*1024;send(e){if(this.ws?.readyState===WebSocket.OPEN){if(this.ws.bufferedAmount>V0.MAX_BUFFERED&&e.type!=="terminal_input")return;this.ws.send(JSON.stringify(e))}}setToken(e){this.options.token=e}getRawSocket(){return this.ws}getLastSeq(){return this.lastSeq}dispose(){this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,this.ws.onopen=null,this.ws.close(),this.ws=null)}scheduleReconnect(){if(this.disposed)return;const e=Math.min(cO*Math.pow(2,this.reconnectAttempt),uO);this.reconnectAttempt++,this.options.onStatus("reconnecting"),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}}const CS=n=>{let e;const t=new Set,i=(h,p)=>{const f=typeof h=="function"?h(e):h;if(!Object.is(f,e)){const m=e;e=p??(typeof f!="object"||f===null)?f:Object.assign({},e,f),t.forEach(g=>g(e,m))}},r=()=>e,o={setState:i,getState:r,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h))},u=e=n(i,r,o);return o},hO=(n=>n?CS(n):CS),dO=n=>n;function fO(n,e=dO){const t=Oh.useSyncExternalStore(n.subscribe,Oh.useCallback(()=>e(n.getState()),[n,e]),Oh.useCallback(()=>e(n.getInitialState()),[n,e]));return Oh.useDebugValue(t),t}const ES=n=>{const e=hO(n),t=i=>fO(e,i);return Object.assign(t,e),t},Tl=(n=>n?ES(n):ES),yn=Tl(n=>({sessions:new Map,selectedSessionId:null,addSession:e=>n(t=>{const i=new Map(t.sessions);return i.set(e.sessionId,e),{sessions:i}}),removeSession:e=>n(t=>{const i=new Map(t.sessions);i.delete(e);const r=t.selectedSessionId===e?null:t.selectedSessionId;return{sessions:i,selectedSessionId:r}}),updateSession:e=>n(t=>{const i=new Map(t.sessions);e.replacesId&&i.delete(e.replacesId),i.set(e.sessionId,e);let r=t.selectedSessionId;return e.replacesId&&t.selectedSessionId===e.replacesId&&(r=e.sessionId),{sessions:i,selectedSessionId:r}}),selectSession:e=>n({selectedSessionId:e}),deselectSession:()=>n({selectedSessionId:null}),setSessions:e=>n({sessions:e})}));var Mp={exports:{}},pO=Mp.exports,kS;function mO(){return kS||(kS=1,(function(n,e){((t,i)=>{n.exports=i()})(pO,function(){var t=function(E,R){return(t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(I,z){I.__proto__=z}:function(I,z){for(var q in z)Object.prototype.hasOwnProperty.call(z,q)&&(I[q]=z[q])}))(E,R)},i=function(){return(i=Object.assign||function(E){for(var R,I=1,z=arguments.length;I<z;I++)for(var q in R=arguments[I])Object.prototype.hasOwnProperty.call(R,q)&&(E[q]=R[q]);return E}).apply(this,arguments)};function r(E,R,I){for(var z,q=0,G=R.length;q<G;q++)!z&&q in R||((z=z||Array.prototype.slice.call(R,0,q))[q]=R[q]);return E.concat(z||Array.prototype.slice.call(R))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:jT,l=Object.keys,o=Array.isArray;function u(E,R){return typeof R=="object"&&l(R).forEach(function(I){E[I]=R[I]}),E}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var h=Object.getPrototypeOf,p={}.hasOwnProperty;function f(E,R){return p.call(E,R)}function m(E,R){typeof R=="function"&&(R=R(h(E))),(typeof Reflect>"u"?l:Reflect.ownKeys)(R).forEach(function(I){_(E,I,R[I])})}var g=Object.defineProperty;function _(E,R,I,z){g(E,R,u(I&&f(I,"get")&&typeof I.get=="function"?{get:I.get,set:I.set,configurable:!0}:{value:I,configurable:!0,writable:!0},z))}function w(E){return{from:function(R){return E.prototype=Object.create(R.prototype),_(E.prototype,"constructor",E),{extend:m.bind(null,E.prototype)}}}}var v=Object.getOwnPropertyDescriptor,x=[].slice;function S(E,R,I){return x.call(E,R,I)}function b(E,R){return R(E)}function C(E){if(!E)throw new Error("Assertion Failed")}function O(E){a.setImmediate?setImmediate(E):setTimeout(E,0)}function M(E,R){if(typeof R=="string"&&f(E,R))return E[R];if(!R)return E;if(typeof R!="string"){for(var I=[],z=0,q=R.length;z<q;++z){var G=M(E,R[z]);I.push(G)}return I}var te,re=R.indexOf(".");return re===-1||(te=E[R.substr(0,re)])==null?void 0:M(te,R.substr(re+1))}function D(E,R,I){if(E&&R!==void 0&&!("isFrozen"in Object&&Object.isFrozen(E)))if(typeof R!="string"&&"length"in R){C(typeof I!="string"&&"length"in I);for(var z=0,q=R.length;z<q;++z)D(E,R[z],I[z])}else{var G,te,re=R.indexOf(".");re!==-1?(G=R.substr(0,re),(re=R.substr(re+1))===""?I===void 0?o(E)&&!isNaN(parseInt(G))?E.splice(G,1):delete E[G]:E[G]=I:D(te=(te=E[G])&&f(E,G)?te:E[G]={},re,I)):I===void 0?o(E)&&!isNaN(parseInt(R))?E.splice(R,1):delete E[R]:E[R]=I}}function N(E){var R,I={};for(R in E)f(E,R)&&(I[R]=E[R]);return I}var B=[].concat;function U(E){return B.apply([],E)}var $="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(U([8,16,32,64].map(function(E){return["Int","Uint","Float"].map(function(R){return R+E+"Array"})}))).filter(function(E){return a[E]}),Y=new Set($.map(function(E){return a[E]})),K=null;function H(E){return K=new WeakMap,E=(function R(I){if(!I||typeof I!="object")return I;var z=K.get(I);if(z)return z;if(o(I)){z=[],K.set(I,z);for(var q=0,G=I.length;q<G;++q)z.push(R(I[q]))}else if(Y.has(I.constructor))z=I;else{var te,re=h(I);for(te in z=re===Object.prototype?{}:Object.create(re),K.set(I,z),I)f(I,te)&&(z[te]=R(I[te]))}return z})(E),K=null,E}var J={}.toString;function Q(E){return J.call(E).slice(8,-1)}var Z=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ie=typeof Z=="symbol"?function(E){var R;return E!=null&&(R=E[Z])&&R.apply(E)}:function(){return null};function ne(E,R){R=E.indexOf(R),0<=R&&E.splice(R,1)}var P={};function L(E){var R,I,z,q;if(arguments.length===1){if(o(E))return E.slice();if(this===P&&typeof E=="string")return[E];if(q=ie(E))for(I=[];!(z=q.next()).done;)I.push(z.value);else{if(E==null)return[E];if(typeof(R=E.length)!="number")return[E];for(I=new Array(R);R--;)I[R]=E[R]}}else for(R=arguments.length,I=new Array(R);R--;)I[R]=arguments[R];return I}var F=typeof Symbol<"u"?function(E){return E[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},$=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],_e=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat($),W={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ye(E,R){this.name=E,this.message=R}function be(E,R){return E+". Errors: "+Object.keys(R).map(function(I){return R[I].toString()}).filter(function(I,z,q){return q.indexOf(I)===z}).join(`
13
+ `)}function Ne(E,R,I,z){this.failures=R,this.failedKeys=z,this.successCount=I,this.message=be(E,R)}function le(E,R){this.name="BulkError",this.failures=Object.keys(R).map(function(I){return R[I]}),this.failuresByPos=R,this.message=be(E,this.failures)}w(ye).from(Error).extend({toString:function(){return this.name+": "+this.message}}),w(Ne).from(ye),w(le).from(ye);var ee=_e.reduce(function(E,R){return E[R]=R+"Error",E},{}),Ce=ye,xe=_e.reduce(function(E,R){var I=R+"Error";function z(q,G){this.name=I,q?typeof q=="string"?(this.message="".concat(q).concat(G?`
14
+ `+G:""),this.inner=G||null):typeof q=="object"&&(this.message="".concat(q.name," ").concat(q.message),this.inner=q):(this.message=W[R]||I,this.inner=null)}return w(z).from(Ce),E[R]=z,E},{}),Ze=(xe.Syntax=SyntaxError,xe.Type=TypeError,xe.Range=RangeError,$.reduce(function(E,R){return E[R+"Error"]=xe[R],E},{}));$=_e.reduce(function(E,R){return["Syntax","Type","Range"].indexOf(R)===-1&&(E[R+"Error"]=xe[R]),E},{});function De(){}function wt(E){return E}function Fe(E,R){return E==null||E===wt?R:function(I){return R(E(I))}}function qe(E,R){return function(){E.apply(this,arguments),R.apply(this,arguments)}}function ze(E,R){return E===De?R:function(){var I=E.apply(this,arguments),z=(I!==void 0&&(arguments[0]=I),this.onsuccess),q=this.onerror,G=(this.onsuccess=null,this.onerror=null,R.apply(this,arguments));return z&&(this.onsuccess=this.onsuccess?qe(z,this.onsuccess):z),q&&(this.onerror=this.onerror?qe(q,this.onerror):q),G!==void 0?G:I}}function Ue(E,R){return E===De?R:function(){E.apply(this,arguments);var I=this.onsuccess,z=this.onerror;this.onsuccess=this.onerror=null,R.apply(this,arguments),I&&(this.onsuccess=this.onsuccess?qe(I,this.onsuccess):I),z&&(this.onerror=this.onerror?qe(z,this.onerror):z)}}function at(E,R){return E===De?R:function(q){var z=E.apply(this,arguments),q=(u(q,z),this.onsuccess),G=this.onerror,te=(this.onsuccess=null,this.onerror=null,R.apply(this,arguments));return q&&(this.onsuccess=this.onsuccess?qe(q,this.onsuccess):q),G&&(this.onerror=this.onerror?qe(G,this.onerror):G),z===void 0?te===void 0?void 0:te:u(z,te)}}function Lt(E,R){return E===De?R:function(){return R.apply(this,arguments)!==!1&&E.apply(this,arguments)}}function St(E,R){return E===De?R:function(){var I=E.apply(this,arguments);if(I&&typeof I.then=="function"){for(var z=this,q=arguments.length,G=new Array(q);q--;)G[q]=arguments[q];return I.then(function(){return R.apply(z,G)})}return R.apply(this,arguments)}}$.ModifyError=Ne,$.DexieError=ye,$.BulkError=le;var Tt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Re(E){Tt=E}var He={},st=100,kt=typeof Promise>"u"?[]:(_e=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[kt=crypto.subtle.digest("SHA-512",new Uint8Array([0])),h(kt),_e]:[_e,h(_e),_e]),_e=kt[0],ha=kt[1],ha=ha&&ha.then,Ve=_e&&_e.constructor,ft=!!kt[2],Et=function(E,R){Fi.push([E,R]),Tn&&(queueMicrotask(Ft),Tn=!1)},Pt=!0,Tn=!0,Ht=[],Pn=[],Un=wt,Vn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:De,pgp:!1,env:{},finalize:De},et=Vn,Fi=[],Jn=0,ia=[];function rt(E){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var R=this._PSD=et;if(typeof E!="function"){if(E!==He)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&ki(this,this._value)}else this._state=null,this._value=null,++R.ref,(function I(z,q){try{q(function(G){if(z._state===null){if(G===z)throw new TypeError("A promise cannot be resolved with itself.");var te=z._lib&&_n();G&&typeof G.then=="function"?I(z,function(re,ue){G instanceof rt?G._then(re,ue):G.then(re,ue)}):(z._state=!0,z._value=G,oe(z)),te&&fn()}},ki.bind(null,z))}catch(G){ki(z,G)}})(this,E)}var ks={get:function(){var E=et,R=ss;function I(z,q){var G=this,te=!E.global&&(E!==et||R!==ss),re=te&&!Di(),ue=new rt(function(Se,he){Be(G,new As(Va(z,E,te,re),Va(q,E,te,re),Se,he,E))});return this._consoleTask&&(ue._consoleTask=this._consoleTask),ue}return I.prototype=He,I},set:function(E){_(this,"then",E&&E.prototype===He?ks:{get:function(){return E},set:ks.set})}};function As(E,R,I,z,q){this.onFulfilled=typeof E=="function"?E:null,this.onRejected=typeof R=="function"?R:null,this.resolve=I,this.reject=z,this.psd=q}function ki(E,R){var I,z;Pn.push(R),E._state===null&&(I=E._lib&&_n(),R=Un(R),E._state=!1,E._value=R,z=E,Ht.some(function(q){return q._value===z._value})||Ht.push(z),oe(E),I)&&fn()}function oe(E){var R=E._listeners;E._listeners=[];for(var I=0,z=R.length;I<z;++I)Be(E,R[I]);var q=E._PSD;--q.ref||q.finalize(),Jn===0&&(++Jn,Et(function(){--Jn==0&&_t()},[]))}function Be(E,R){if(E._state===null)E._listeners.push(R);else{var I=E._state?R.onFulfilled:R.onRejected;if(I===null)return(E._state?R.resolve:R.reject)(E._value);++R.psd.ref,++Jn,Et(ot,[I,E,R])}}function ot(E,R,I){try{var z,q=R._value;!R._state&&Pn.length&&(Pn=[]),z=Tt&&R._consoleTask?R._consoleTask.run(function(){return E(q)}):E(q),R._state||Pn.indexOf(q)!==-1||(G=>{for(var te=Ht.length;te;)if(Ht[--te]._value===G._value)return Ht.splice(te,1)})(R),I.resolve(z)}catch(G){I.reject(G)}finally{--Jn==0&&_t(),--I.psd.ref||I.psd.finalize()}}function Ft(){Qi(Vn,function(){_n()&&fn()})}function _n(){var E=Pt;return Tn=Pt=!1,E}function fn(){var E,R,I;do for(;0<Fi.length;)for(E=Fi,Fi=[],I=E.length,R=0;R<I;++R){var z=E[R];z[0].apply(null,z[1])}while(0<Fi.length);Tn=Pt=!0}function _t(){for(var E=Ht,R=(Ht=[],E.forEach(function(z){z._PSD.onunhandled.call(null,z._value,z)}),ia.slice(0)),I=R.length;I;)R[--I]()}function dt(E){return new rt(He,!1,E)}function ut(E,R){var I=et;return function(){var z=_n(),q=et;try{return Ji(I,!0),E.apply(this,arguments)}catch(G){R&&R(G)}finally{Ji(q,!1),z&&fn()}}}m(rt.prototype,{then:ks,_then:function(E,R){Be(this,new As(null,null,E,R,et))},catch:function(E){var R,I;return arguments.length===1?this.then(null,E):(R=E,I=arguments[1],typeof R=="function"?this.then(null,function(z){return(z instanceof R?I:dt)(z)}):this.then(null,function(z){return(z&&z.name===R?I:dt)(z)}))},finally:function(E){return this.then(function(R){return rt.resolve(E()).then(function(){return R})},function(R){return rt.resolve(E()).then(function(){return dt(R)})})},timeout:function(E,R){var I=this;return E<1/0?new rt(function(z,q){var G=setTimeout(function(){return q(new xe.Timeout(R))},E);I.then(z,q).finally(clearTimeout.bind(null,G))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&_(rt.prototype,Symbol.toStringTag,"Dexie.Promise"),Vn.env=jo(),m(rt,{all:function(){var E=L.apply(null,arguments).map(Ts);return new rt(function(R,I){E.length===0&&R([]);var z=E.length;E.forEach(function(q,G){return rt.resolve(q).then(function(te){E[G]=te,--z||R(E)},I)})})},resolve:function(E){return E instanceof rt?E:E&&typeof E.then=="function"?new rt(function(R,I){E.then(R,I)}):new rt(He,!0,E)},reject:dt,race:function(){var E=L.apply(null,arguments).map(Ts);return new rt(function(R,I){E.map(function(z){return rt.resolve(z).then(R,I)})})},PSD:{get:function(){return et},set:function(E){return et=E}},totalEchoes:{get:function(){return ss}},newPSD:Mn,usePSD:Qi,scheduler:{get:function(){return Et},set:function(E){Et=E}},rejectionMapper:{get:function(){return Un},set:function(E){Un=E}},follow:function(E,R){return new rt(function(I,z){return Mn(function(q,G){var te=et;te.unhandleds=[],te.onunhandled=G,te.finalize=qe(function(){var re,ue=this;re=function(){ue.unhandleds.length===0?q():G(ue.unhandleds[0])},ia.push(function Se(){re(),ia.splice(ia.indexOf(Se),1)}),++Jn,Et(function(){--Jn==0&&_t()},[])},te.finalize),E()},R,I,z)})}}),Ve&&(Ve.allSettled&&_(rt,"allSettled",function(){var E=L.apply(null,arguments).map(Ts);return new rt(function(R){E.length===0&&R([]);var I=E.length,z=new Array(I);E.forEach(function(q,G){return rt.resolve(q).then(function(te){return z[G]={status:"fulfilled",value:te}},function(te){return z[G]={status:"rejected",reason:te}}).then(function(){return--I||R(z)})})})}),Ve.any&&typeof AggregateError<"u"&&_(rt,"any",function(){var E=L.apply(null,arguments).map(Ts);return new rt(function(R,I){E.length===0&&I(new AggregateError([]));var z=E.length,q=new Array(z);E.forEach(function(G,te){return rt.resolve(G).then(function(re){return R(re)},function(re){q[te]=re,--z||I(new AggregateError(q))})})})}),Ve.withResolvers)&&(rt.withResolvers=Ve.withResolvers);var nn={awaits:0,echoes:0,id:0},Hn=0,ur=[],rs=0,ss=0,Fr=0;function Mn(E,te,I,z){var q=et,G=Object.create(q),te=(G.parent=q,G.ref=0,G.global=!1,G.id=++Fr,Vn.env,G.env=ft?{Promise:rt,PromiseProp:{value:rt,configurable:!0,writable:!0},all:rt.all,race:rt.race,allSettled:rt.allSettled,any:rt.any,resolve:rt.resolve,reject:rt.reject}:{},te&&u(G,te),++q.ref,G.finalize=function(){--this.parent.ref||this.parent.finalize()},Qi(G,E,I,z));return G.ref===0&&G.finalize(),te}function Qn(){return nn.id||(nn.id=++Hn),++nn.awaits,nn.echoes+=st,nn.id}function Di(){return!!nn.awaits&&(--nn.awaits==0&&(nn.id=0),nn.echoes=nn.awaits*st,!0)}function Ts(E){return nn.echoes&&E&&E.constructor===Ve?(Qn(),E.then(function(R){return Di(),R},function(R){return Di(),En(R)})):E}function Dl(){var E=ur[ur.length-1];ur.pop(),Ji(E,!1)}function Ji(E,R){var I,z,q=et;(R?!nn.echoes||rs++&&E===et:!rs||--rs&&E===et)||queueMicrotask(R?(function(G){++ss,nn.echoes&&--nn.echoes!=0||(nn.echoes=nn.awaits=nn.id=0),ur.push(et),Ji(G,!0)}).bind(null,E):Dl),E!==et&&(et=E,q===Vn&&(Vn.env=jo()),ft)&&(I=Vn.env.Promise,z=E.env,q.global||E.global)&&(Object.defineProperty(a,"Promise",z.PromiseProp),I.all=z.all,I.race=z.race,I.resolve=z.resolve,I.reject=z.reject,z.allSettled&&(I.allSettled=z.allSettled),z.any)&&(I.any=z.any)}function jo(){var E=a.Promise;return ft?{Promise:E,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:E.all,race:E.race,allSettled:E.allSettled,any:E.any,resolve:E.resolve,reject:E.reject}:{}}function Qi(E,R,I,z,q){var G=et;try{return Ji(E,!0),R(I,z,q)}finally{Ji(G,!1)}}function Va(E,R,I,z){return typeof E!="function"?E:function(){var q=et;I&&Qn(),Ji(R,!0);try{return E.apply(this,arguments)}finally{Ji(q,!1),z&&queueMicrotask(Di)}}}function xi(E){Promise===Ve&&nn.echoes===0?rs===0?E():enqueueNativeMicroTask(E):setTimeout(E,0)}(""+ha).indexOf("[native code]")===-1&&(Qn=Di=De);var En=rt.reject,ji="￿",Ai="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",ei="String expected.",as=[],jr="__dbnames",vr="readonly",Xe="readwrite";function vt(E,R){return E?R?function(){return E.apply(this,arguments)&&R.apply(this,arguments)}:E:R}var Jt={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function pn(E){return typeof E!="string"||/\./.test(E)?function(R){return R}:function(R){return R[E]===void 0&&E in R&&delete(R=H(R))[E],R}}function Yn(){throw xe.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Dt(E,R){try{var I=Ui(E),z=Ui(R);if(I!==z)return I==="Array"?1:z==="Array"?-1:I==="binary"?1:z==="binary"?-1:I==="string"?1:z==="string"?-1:I==="Date"?1:z!=="Date"?NaN:-1;switch(I){case"number":case"Date":case"string":return R<E?1:E<R?-1:0;case"binary":for(var q=Ii(E),G=Ii(R),te=q.length,re=G.length,ue=te<re?te:re,Se=0;Se<ue;++Se)if(q[Se]!==G[Se])return q[Se]<G[Se]?-1:1;return te===re?0:te<re?-1:1;case"Array":for(var he=E,ce=R,pe=he.length,ge=ce.length,de=pe<ge?pe:ge,fe=0;fe<de;++fe){var Ee=Dt(he[fe],ce[fe]);if(Ee!==0)return Ee}return pe===ge?0:pe<ge?-1:1}}catch{}return NaN}function Ui(E){var R=typeof E;return R=="object"&&(ArrayBuffer.isView(E)||(R=Q(E))==="ArrayBuffer")?"binary":R}function Ii(E){return E instanceof Uint8Array?E:ArrayBuffer.isView(E)?new Uint8Array(E.buffer,E.byteOffset,E.byteLength):new Uint8Array(E)}function kn(E,R,I){var z=E.schema.yProps;return z?(R&&0<I.numFailures&&(R=R.filter(function(q,G){return!I.failures[G]})),Promise.all(z.map(function(q){return q=q.updatesTable,R?E.db.table(q).where("k").anyOf(R).delete():E.db.table(q).clear()})).then(function(){return I})):I}Uo.prototype.execute=function(E){var R=this["@@propmod"];if(R.add!==void 0){var I=R.add;if(o(I))return r(r([],o(E)?E:[],!0),I).sort();if(typeof I=="number")return(Number(E)||0)+I;if(typeof I=="bigint")try{return BigInt(E)+I}catch{return BigInt(0)+I}throw new TypeError("Invalid term ".concat(I))}if(R.remove!==void 0){var z=R.remove;if(o(z))return o(E)?E.filter(function(q){return!z.includes(q)}).sort():[];if(typeof z=="number")return Number(E)-z;if(typeof z=="bigint")try{return BigInt(E)-z}catch{return BigInt(0)-z}throw new TypeError("Invalid subtrahend ".concat(z))}return I=(I=R.replacePrefix)==null?void 0:I[0],I&&typeof E=="string"&&E.startsWith(I)?R.replacePrefix[1]+E.substring(I.length):E};var Si=Uo;function Uo(E){this["@@propmod"]=E}function ra(E,R){for(var I=l(R),z=I.length,q=!1,G=0;G<z;++G){var te=I[G],re=R[te],ue=M(E,te);re instanceof Si?(D(E,te,re.execute(ue)),q=!0):ue!==re&&(D(E,te,re),q=!0)}return q}gn.prototype._trans=function(E,R,I){var z=this._tx||et.trans,q=this.name,G=Tt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(E==="readonly"?"read":"write"," ").concat(this.name));function te(Se,he,ce){if(ce.schema[q])return R(ce.idbtrans,ce);throw new xe.NotFound("Table "+q+" not part of transaction")}var re=_n();try{var ue=z&&z.db._novip===this.db._novip?z===et.trans?z._promise(E,te,I):Mn(function(){return z._promise(E,te,I)},{trans:z,transless:et.transless||et}):(function Se(he,ce,pe,ge){if(he.idbdb&&(he._state.openComplete||et.letThrough||he._vip)){var de=he._createTransaction(ce,pe,he._dbSchema);try{de.create(),he._state.PR1398_maxLoop=3}catch(fe){return fe.name===ee.InvalidState&&he.isOpen()&&0<--he._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),he.close({disableAutoOpen:!1}),he.open().then(function(){return Se(he,ce,pe,ge)})):En(fe)}return de._promise(ce,function(fe,Ee){return Mn(function(){return et.trans=de,ge(fe,Ee,de)})}).then(function(fe){if(ce==="readwrite")try{de.idbtrans.commit()}catch{}return ce==="readonly"?fe:de._completion.then(function(){return fe})})}if(he._state.openComplete)return En(new xe.DatabaseClosed(he._state.dbOpenError));if(!he._state.isBeingOpened){if(!he._state.autoOpen)return En(new xe.DatabaseClosed);he.open().catch(De)}return he._state.dbReadyPromise.then(function(){return Se(he,ce,pe,ge)})})(this.db,E,[this.name],te);return G&&(ue._consoleTask=G,ue=ue.catch(function(Se){return console.trace(Se),En(Se)})),ue}finally{re&&fn()}},gn.prototype.get=function(E,R){var I=this;return E&&E.constructor===Object?this.where(E).first(R):E==null?En(new xe.Type("Invalid argument to Table.get()")):this._trans("readonly",function(z){return I.core.get({trans:z,key:E}).then(function(q){return I.hook.reading.fire(q)})}).then(R)},gn.prototype.where=function(E){if(typeof E=="string")return new this.db.WhereClause(this,E);if(o(E))return new this.db.WhereClause(this,"[".concat(E.join("+"),"]"));var R=l(E);if(R.length===1)return this.where(R[0]).equals(E[R[0]]);var I=this.schema.indexes.concat(this.schema.primKey).filter(function(re){if(re.compound&&R.every(function(Se){return 0<=re.keyPath.indexOf(Se)})){for(var ue=0;ue<R.length;++ue)if(R.indexOf(re.keyPath[ue])===-1)return!1;return!0}return!1}).sort(function(re,ue){return re.keyPath.length-ue.keyPath.length})[0];if(I&&this.db._maxKey!==ji)return te=I.keyPath.slice(0,R.length),this.where(te).equals(te.map(function(re){return E[re]}));!I&&Tt&&console.warn("The query ".concat(JSON.stringify(E)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(R.join("+"),"]"));var z=this.schema.idxByName;function q(re,ue){return Dt(re,ue)===0}var te=R.reduce(function(he,ue){var Se=he[0],he=he[1],ce=z[ue],pe=E[ue];return[Se||ce,Se||!ce?vt(he,ce&&ce.multi?function(ge){return ge=M(ge,ue),o(ge)&&ge.some(function(de){return q(pe,de)})}:function(ge){return q(pe,M(ge,ue))}):he]},[null,null]),G=te[0],te=te[1];return G?this.where(G.name).equals(E[G.keyPath]).filter(te):I?this.filter(te):this.where(R).equals("")},gn.prototype.filter=function(E){return this.toCollection().and(E)},gn.prototype.count=function(E){return this.toCollection().count(E)},gn.prototype.offset=function(E){return this.toCollection().offset(E)},gn.prototype.limit=function(E){return this.toCollection().limit(E)},gn.prototype.each=function(E){return this.toCollection().each(E)},gn.prototype.toArray=function(E){return this.toCollection().toArray(E)},gn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},gn.prototype.orderBy=function(E){return new this.db.Collection(new this.db.WhereClause(this,o(E)?"[".concat(E.join("+"),"]"):E))},gn.prototype.reverse=function(){return this.toCollection().reverse()},gn.prototype.mapToClass=function(E){for(var R=this.db,I=this.name,z=((this.schema.mappedClass=E).prototype instanceof Yn&&(E=(te=>{var re=he,ue=te;if(typeof ue!="function"&&ue!==null)throw new TypeError("Class extends value "+String(ue)+" is not a constructor or null");function Se(){this.constructor=re}function he(){return te!==null&&te.apply(this,arguments)||this}return t(re,ue),re.prototype=ue===null?Object.create(ue):(Se.prototype=ue.prototype,new Se),Object.defineProperty(he.prototype,"db",{get:function(){return R},enumerable:!1,configurable:!0}),he.prototype.table=function(){return I},he})(E)),new Set),q=E.prototype;q;q=h(q))Object.getOwnPropertyNames(q).forEach(function(te){return z.add(te)});function G(te){if(!te)return te;var re,ue=Object.create(E.prototype);for(re in te)if(!z.has(re))try{ue[re]=te[re]}catch{}return ue}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=G,this.hook("reading",G),E},gn.prototype.defineClass=function(){return this.mapToClass(function(E){u(this,E)})},gn.prototype.add=function(E,R){var I=this,z=this.schema.primKey,q=z.auto,G=z.keyPath,te=E;return G&&q&&(te=pn(G)(E)),this._trans("readwrite",function(re){return I.core.mutate({trans:re,type:"add",keys:R!=null?[R]:null,values:[te]})}).then(function(re){return re.numFailures?rt.reject(re.failures[0]):re.lastResult}).then(function(re){if(G)try{D(E,G,re)}catch{}return re})},gn.prototype.upsert=function(E,R){var I=this,z=this.schema.primKey.keyPath;return this._trans("readwrite",function(q){return I.core.get({trans:q,key:E}).then(function(G){var te=G??{};return ra(te,R),z&&D(te,z,E),I.core.mutate({trans:q,type:"put",values:[te],keys:[E],upsert:!0,updates:{keys:[E],changeSpecs:[R]}}).then(function(re){return re.numFailures?rt.reject(re.failures[0]):!!G})})})},gn.prototype.update=function(E,R){return typeof E!="object"||o(E)?this.where(":id").equals(E).modify(R):(E=M(E,this.schema.primKey.keyPath))===void 0?En(new xe.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(E).modify(R)},gn.prototype.put=function(E,R){var I=this,z=this.schema.primKey,q=z.auto,G=z.keyPath,te=E;return G&&q&&(te=pn(G)(E)),this._trans("readwrite",function(re){return I.core.mutate({trans:re,type:"put",values:[te],keys:R!=null?[R]:null})}).then(function(re){return re.numFailures?rt.reject(re.failures[0]):re.lastResult}).then(function(re){if(G)try{D(E,G,re)}catch{}return re})},gn.prototype.delete=function(E){var R=this;return this._trans("readwrite",function(I){return R.core.mutate({trans:I,type:"delete",keys:[E]}).then(function(z){return kn(R,[E],z)}).then(function(z){return z.numFailures?rt.reject(z.failures[0]):void 0})})},gn.prototype.clear=function(){var E=this;return this._trans("readwrite",function(R){return E.core.mutate({trans:R,type:"deleteRange",range:Jt}).then(function(I){return kn(E,null,I)})}).then(function(R){return R.numFailures?rt.reject(R.failures[0]):void 0})},gn.prototype.bulkGet=function(E){var R=this;return this._trans("readonly",function(I){return R.core.getMany({keys:E,trans:I}).then(function(z){return z.map(function(q){return R.hook.reading.fire(q)})})})},gn.prototype.bulkAdd=function(E,R,I){var z=this,q=Array.isArray(R)?R:void 0,G=(I=I||(q?void 0:R))?I.allKeys:void 0;return this._trans("readwrite",function(te){var re=z.schema.primKey,Se=re.auto,re=re.keyPath;if(re&&q)throw new xe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(q&&q.length!==E.length)throw new xe.InvalidArgument("Arguments objects and keys must have the same length");var ue=E.length,Se=re&&Se?E.map(pn(re)):E;return z.core.mutate({trans:te,type:"add",keys:q,values:Se,wantResults:G}).then(function(he){var ce=he.numFailures,pe=he.failures;if(ce===0)return G?he.results:he.lastResult;throw new le("".concat(z.name,".bulkAdd(): ").concat(ce," of ").concat(ue," operations failed"),pe)})})},gn.prototype.bulkPut=function(E,R,I){var z=this,q=Array.isArray(R)?R:void 0,G=(I=I||(q?void 0:R))?I.allKeys:void 0;return this._trans("readwrite",function(te){var re=z.schema.primKey,Se=re.auto,re=re.keyPath;if(re&&q)throw new xe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(q&&q.length!==E.length)throw new xe.InvalidArgument("Arguments objects and keys must have the same length");var ue=E.length,Se=re&&Se?E.map(pn(re)):E;return z.core.mutate({trans:te,type:"put",keys:q,values:Se,wantResults:G}).then(function(he){var ce=he.numFailures,pe=he.failures;if(ce===0)return G?he.results:he.lastResult;throw new le("".concat(z.name,".bulkPut(): ").concat(ce," of ").concat(ue," operations failed"),pe)})})},gn.prototype.bulkUpdate=function(E){var R=this,I=this.core,z=E.map(function(te){return te.key}),q=E.map(function(te){return te.changes}),G=[];return this._trans("readwrite",function(te){return I.getMany({trans:te,keys:z,cache:"clone"}).then(function(re){var ue=[],Se=[],he=(E.forEach(function(ce,pe){var ge=ce.key,de=ce.changes,fe=re[pe];if(fe){for(var Ee=0,Te=Object.keys(de);Ee<Te.length;Ee++){var we=Te[Ee],Ie=de[we];if(we===R.schema.primKey.keyPath){if(Dt(Ie,ge)!==0)throw new xe.Constraint("Cannot update primary key in bulkUpdate()")}else D(fe,we,Ie)}G.push(pe),ue.push(ge),Se.push(fe)}}),ue.length);return I.mutate({trans:te,type:"put",keys:ue,values:Se,updates:{keys:z,changeSpecs:q}}).then(function(ce){var pe=ce.numFailures,ge=ce.failures;if(pe===0)return he;for(var de=0,fe=Object.keys(ge);de<fe.length;de++){var Ee,Te=fe[de],we=G[Number(Te)];we!=null&&(Ee=ge[Te],delete ge[Te],ge[we]=Ee)}throw new le("".concat(R.name,".bulkUpdate(): ").concat(pe," of ").concat(he," operations failed"),ge)})})})},gn.prototype.bulkDelete=function(E){var R=this,I=E.length;return this._trans("readwrite",function(z){return R.core.mutate({trans:z,type:"delete",keys:E}).then(function(q){return kn(R,E,q)})}).then(function(z){var q=z.numFailures,G=z.failures;if(q===0)return z.lastResult;throw new le("".concat(R.name,".bulkDelete(): ").concat(q," of ").concat(I," operations failed"),G)})};var Wa=gn;function gn(){}function sa(E){function R(te,re){if(re){for(var ue=arguments.length,Se=new Array(ue-1);--ue;)Se[ue-1]=arguments[ue];return I[te].subscribe.apply(null,Se),E}if(typeof te=="string")return I[te]}var I={};R.addEventType=G;for(var z=1,q=arguments.length;z<q;++z)G(arguments[z]);return R;function G(te,re,ue){var Se,he;if(typeof te!="object")return re=re||Lt,he={subscribers:[],fire:ue=ue||De,subscribe:function(ce){he.subscribers.indexOf(ce)===-1&&(he.subscribers.push(ce),he.fire=re(he.fire,ce))},unsubscribe:function(ce){he.subscribers=he.subscribers.filter(function(pe){return pe!==ce}),he.fire=he.subscribers.reduce(re,ue)}},I[te]=R[te]=he;l(Se=te).forEach(function(ce){var pe=Se[ce];if(o(pe))G(ce,Se[ce][0],Se[ce][1]);else{if(pe!=="asap")throw new xe.InvalidArgument("Invalid event config");var ge=G(ce,wt,function(){for(var de=arguments.length,fe=new Array(de);de--;)fe[de]=arguments[de];ge.subscribers.forEach(function(Ee){O(function(){Ee.apply(null,fe)})})})}})}}function hi(E,R){return w(R).from({prototype:E}),R}function Ur(E,R){return!(E.filter||E.algorithm||E.or)&&(R?E.justLimit:!E.replayFilter)}function os(E,R){E.filter=vt(E.filter,R)}function Ms(E,R,I){var z=E.replayFilter;E.replayFilter=z?function(){return vt(z(),R())}:R,E.justLimit=I&&!z}function ri(E,R){if(E.isPrimKey)return R.primaryKey;var I=R.getIndexByKeyPath(E.index);if(I)return I;throw new xe.Schema("KeyPath "+E.index+" on object store "+R.name+" is not indexed")}function Ho(E,R,I){var z=ri(E,R.schema);return R.openCursor({trans:I,values:!E.keysOnly,reverse:E.dir==="prev",unique:!!E.unique,query:{index:z,range:E.range}})}function ls(E,R,I,z){var q,G,te=E.replayFilter?vt(E.filter,E.replayFilter()):E.filter;return E.or?(q={},G=function(re,ue,Se){var he,ce;te&&!te(ue,Se,function(pe){return ue.stop(pe)},function(pe){return ue.fail(pe)})||((ce=""+(he=ue.primaryKey))=="[object ArrayBuffer]"&&(ce=""+new Uint8Array(he)),f(q,ce))||(q[ce]=!0,R(re,ue,Se))},Promise.all([E.or._iterate(G,I),Rt(Ho(E,z,I),E.algorithm,G,!E.keysOnly&&E.valueMapper)])):Rt(Ho(E,z,I),vt(E.algorithm,te),R,!E.keysOnly&&E.valueMapper)}function Rt(E,R,I,z){var q=ut(z?function(G,te,re){return I(z(G),te,re)}:I);return E.then(function(G){if(G)return G.start(function(){var te=function(){return G.continue()};R&&!R(G,function(re){return te=re},function(re){G.stop(re),te=De},function(re){G.fail(re),te=De})||q(G.value,G,function(re){return te=re}),te()})})}Ot.prototype._read=function(E,R){var I=this._ctx;return I.error?I.table._trans(null,En.bind(null,I.error)):I.table._trans("readonly",E).then(R)},Ot.prototype._write=function(E){var R=this._ctx;return R.error?R.table._trans(null,En.bind(null,R.error)):R.table._trans("readwrite",E,"locked")},Ot.prototype._addAlgorithm=function(E){var R=this._ctx;R.algorithm=vt(R.algorithm,E)},Ot.prototype._iterate=function(E,R){return ls(this._ctx,E,R,this._ctx.table.core)},Ot.prototype.clone=function(E){var R=Object.create(this.constructor.prototype),I=Object.create(this._ctx);return E&&u(I,E),R._ctx=I,R},Ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ot.prototype.each=function(E){var R=this._ctx;return this._read(function(I){return ls(R,E,I,R.table.core)})},Ot.prototype.count=function(E){var R=this;return this._read(function(I){var z,q=R._ctx,G=q.table.core;return Ur(q,!0)?G.count({trans:I,query:{index:ri(q,G.schema),range:q.range}}).then(function(te){return Math.min(te,q.limit)}):(z=0,ls(q,function(){return++z,!1},I,G).then(function(){return z}))}).then(E)},Ot.prototype.sortBy=function(E,R){var I=E.split(".").reverse(),z=I[0],q=I.length-1;function G(ue,Se){return Se?G(ue[I[Se]],Se-1):ue[z]}var te=this._ctx.dir==="next"?1:-1;function re(ue,Se){return Dt(G(ue,q),G(Se,q))*te}return this.toArray(function(ue){return ue.sort(re)}).then(R)},Ot.prototype.toArray=function(E){var R=this;return this._read(function(I){var z,q,G,te=R._ctx;return te.dir==="next"&&Ur(te,!0)&&0<te.limit?(z=te.valueMapper,q=ri(te,te.table.core.schema),te.table.core.query({trans:I,limit:te.limit,values:!0,query:{index:q,range:te.range}}).then(function(re){return re=re.result,z?re.map(z):re})):(G=[],ls(te,function(re){return G.push(re)},I,te.table.core).then(function(){return G}))},E)},Ot.prototype.offset=function(E){var R=this._ctx;return E<=0||(R.offset+=E,Ur(R)?Ms(R,function(){var I=E;return function(z,q){return I===0||(I===1?--I:q(function(){z.advance(I),I=0}),!1)}}):Ms(R,function(){var I=E;return function(){return--I<0}})),this},Ot.prototype.limit=function(E){return this._ctx.limit=Math.min(this._ctx.limit,E),Ms(this._ctx,function(){var R=E;return function(I,z,q){return--R<=0&&z(q),0<=R}},!0),this},Ot.prototype.until=function(E,R){return os(this._ctx,function(I,z,q){return!E(I.value)||(z(q),R)}),this},Ot.prototype.first=function(E){return this.limit(1).toArray(function(R){return R[0]}).then(E)},Ot.prototype.last=function(E){return this.reverse().first(E)},Ot.prototype.filter=function(E){var R;return os(this._ctx,function(I){return E(I.value)}),(R=this._ctx).isMatch=vt(R.isMatch,E),this},Ot.prototype.and=function(E){return this.filter(E)},Ot.prototype.or=function(E){return new this.db.WhereClause(this._ctx.table,E,this)},Ot.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ot.prototype.desc=function(){return this.reverse()},Ot.prototype.eachKey=function(E){var R=this._ctx;return R.keysOnly=!R.isMatch,this.each(function(I,z){E(z.key,z)})},Ot.prototype.eachUniqueKey=function(E){return this._ctx.unique="unique",this.eachKey(E)},Ot.prototype.eachPrimaryKey=function(E){var R=this._ctx;return R.keysOnly=!R.isMatch,this.each(function(I,z){E(z.primaryKey,z)})},Ot.prototype.keys=function(E){var R=this._ctx,I=(R.keysOnly=!R.isMatch,[]);return this.each(function(z,q){I.push(q.key)}).then(function(){return I}).then(E)},Ot.prototype.primaryKeys=function(E){var R=this._ctx;if(R.dir==="next"&&Ur(R,!0)&&0<R.limit)return this._read(function(z){var q=ri(R,R.table.core.schema);return R.table.core.query({trans:z,values:!1,limit:R.limit,query:{index:q,range:R.range}})}).then(function(z){return z.result}).then(E);R.keysOnly=!R.isMatch;var I=[];return this.each(function(z,q){I.push(q.primaryKey)}).then(function(){return I}).then(E)},Ot.prototype.uniqueKeys=function(E){return this._ctx.unique="unique",this.keys(E)},Ot.prototype.firstKey=function(E){return this.limit(1).keys(function(R){return R[0]}).then(E)},Ot.prototype.lastKey=function(E){return this.reverse().firstKey(E)},Ot.prototype.distinct=function(){var E,R=this._ctx,R=R.index&&R.table.schema.idxByName[R.index];return R&&R.multi&&(E={},os(this._ctx,function(z){var z=z.primaryKey.toString(),q=f(E,z);return E[z]=!0,!q})),this},Ot.prototype.modify=function(E){var R=this,I=this._ctx;return this._write(function(z){function q(fe,Ee){var Te=Ee.failures;pe+=fe-Ee.numFailures;for(var we=0,Ie=l(Te);we<Ie.length;we++){var $e=Ie[we];ce.push(Te[$e])}}var G=typeof E=="function"?E:function(fe){return ra(fe,E)},te=I.table.core,he=te.schema.primaryKey,re=he.outbound,ue=he.extractKey,Se=200,he=R.db._options.modifyChunkSize,ce=(he&&(Se=typeof he=="object"?he[te.name]||he["*"]||200:he),[]),pe=0,ge=[],de=E===bn;return R.clone().primaryKeys().then(function(fe){function Ee(we){var Ie=Math.min(Se,fe.length-we),$e=fe.slice(we,we+Ie);return(de?Promise.resolve([]):te.getMany({trans:z,keys:$e,cache:"immutable"})).then(function(nt){var it=[],Ge=[],pt=re?[]:null,ct=de?$e:[];if(!de)for(var Ke=0;Ke<Ie;++Ke){var mt=nt[Ke],Ut={value:H(mt),primKey:fe[we+Ke]};G.call(Ut,Ut.value,Ut)!==!1&&(Ut.value==null?ct.push(fe[we+Ke]):re||Dt(ue(mt),ue(Ut.value))===0?(Ge.push(Ut.value),re&&pt.push(fe[we+Ke])):(ct.push(fe[we+Ke]),it.push(Ut.value)))}return Promise.resolve(0<it.length&&te.mutate({trans:z,type:"add",values:it}).then(function(sn){for(var At in sn.failures)ct.splice(parseInt(At),1);q(it.length,sn)})).then(function(){return(0<Ge.length||Te&&typeof E=="object")&&te.mutate({trans:z,type:"put",keys:pt,values:Ge,criteria:Te,changeSpec:typeof E!="function"&&E,isAdditionalChunk:0<we}).then(function(sn){return q(Ge.length,sn)})}).then(function(){return(0<ct.length||Te&&de)&&te.mutate({trans:z,type:"delete",keys:ct,criteria:Te,isAdditionalChunk:0<we}).then(function(sn){return kn(I.table,ct,sn)}).then(function(sn){return q(ct.length,sn)})}).then(function(){return fe.length>we+Ie&&Ee(we+Se)})})}var Te=Ur(I)&&I.limit===1/0&&(typeof E!="function"||de)&&{index:I.index,range:I.range};return Ee(0).then(function(){if(0<ce.length)throw new Ne("Error modifying one or more objects",ce,pe,ge);return fe.length})})})},Ot.prototype.delete=function(){var E=this._ctx,R=E.range;return!Ur(E)||E.table.schema.yProps||!E.isPrimKey&&R.type!==3?this.modify(bn):this._write(function(I){var z=E.table.core.schema.primaryKey,q=R;return E.table.core.count({trans:I,query:{index:z,range:q}}).then(function(G){return E.table.core.mutate({trans:I,type:"deleteRange",range:q}).then(function(ue){var re=ue.failures,ue=ue.numFailures;if(ue)throw new Ne("Could not delete some values",Object.keys(re).map(function(Se){return re[Se]}),G-ue);return G-ue})})})};var Il=Ot;function Ot(){}var bn=function(E,R){return R.value=null};function Rs(E,R){return E<R?-1:E===R?0:1}function cs(E,R){return R<E?-1:E===R?0:1}function wi(E,R,I){return E=E instanceof rn?new E.Collection(E):E,E._ctx.error=new(I||TypeError)(R),E}function er(E){return new E.Collection(E,function(){return qt("")}).limit(0)}function tt(ge,R,I,z){var q,G,te,re,ue,Se,he,ce=I.length;if(!I.every(function(fe){return typeof fe=="string"}))return wi(ge,ei);function pe(fe){q=fe==="next"?function(Te){return Te.toUpperCase()}:function(Te){return Te.toLowerCase()},G=fe==="next"?function(Te){return Te.toLowerCase()}:function(Te){return Te.toUpperCase()},te=fe==="next"?Rs:cs;var Ee=I.map(function(Te){return{lower:G(Te),upper:q(Te)}}).sort(function(Te,we){return te(Te.lower,we.lower)});re=Ee.map(function(Te){return Te.upper}),ue=Ee.map(function(Te){return Te.lower}),he=(Se=fe)==="next"?"":z}pe("next");var ge=new ge.Collection(ge,function(){return yt(re[0],ue[ce-1]+z)}),de=(ge._ondirectionchange=function(fe){pe(fe)},0);return ge._addAlgorithm(function(fe,Ee,Te){var we=fe.key;if(typeof we=="string"){var Ie=G(we);if(R(Ie,ue,de))return!0;for(var $e=null,nt=de;nt<ce;++nt){var it=((Ge,pt,ct,Ke,mt,Ut)=>{for(var sn=Math.min(Ge.length,Ke.length),At=-1,Wt=0;Wt<sn;++Wt){var Dn=pt[Wt];if(Dn!==Ke[Wt])return mt(Ge[Wt],ct[Wt])<0?Ge.substr(0,Wt)+ct[Wt]+ct.substr(Wt+1):mt(Ge[Wt],Ke[Wt])<0?Ge.substr(0,Wt)+Ke[Wt]+ct.substr(Wt+1):0<=At?Ge.substr(0,At)+pt[At]+ct.substr(At+1):null;mt(Ge[Wt],Dn)<0&&(At=Wt)}return sn<Ke.length&&Ut==="next"?Ge+ct.substr(Ge.length):sn<Ge.length&&Ut==="prev"?Ge.substr(0,ct.length):At<0?null:Ge.substr(0,At)+Ke[At]+ct.substr(At+1)})(we,Ie,re[nt],ue[nt],te,Se);it===null&&$e===null?de=nt+1:($e===null||0<te($e,it))&&($e=it)}Ee($e!==null?function(){fe.continue($e+he)}:Te)}return!1}),ge}function yt(E,R,I,z){return{type:2,lower:E,upper:R,lowerOpen:I,upperOpen:z}}function qt(E){return{type:1,lower:E,upper:E}}Object.defineProperty(Yt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Yt.prototype.between=function(E,R,I,z){I=I!==!1,z=z===!0;try{return 0<this._cmp(E,R)||this._cmp(E,R)===0&&(I||z)&&(!I||!z)?er(this):new this.Collection(this,function(){return yt(E,R,!I,!z)})}catch{return wi(this,Ai)}},Yt.prototype.equals=function(E){return E==null?wi(this,Ai):new this.Collection(this,function(){return qt(E)})},Yt.prototype.above=function(E){return E==null?wi(this,Ai):new this.Collection(this,function(){return yt(E,void 0,!0)})},Yt.prototype.aboveOrEqual=function(E){return E==null?wi(this,Ai):new this.Collection(this,function(){return yt(E,void 0,!1)})},Yt.prototype.below=function(E){return E==null?wi(this,Ai):new this.Collection(this,function(){return yt(void 0,E,!1,!0)})},Yt.prototype.belowOrEqual=function(E){return E==null?wi(this,Ai):new this.Collection(this,function(){return yt(void 0,E)})},Yt.prototype.startsWith=function(E){return typeof E!="string"?wi(this,ei):this.between(E,E+ji,!0,!0)},Yt.prototype.startsWithIgnoreCase=function(E){return E===""?this.startsWith(E):tt(this,function(R,I){return R.indexOf(I[0])===0},[E],ji)},Yt.prototype.equalsIgnoreCase=function(E){return tt(this,function(R,I){return R===I[0]},[E],"")},Yt.prototype.anyOfIgnoreCase=function(){var E=L.apply(P,arguments);return E.length===0?er(this):tt(this,function(R,I){return I.indexOf(R)!==-1},E,"")},Yt.prototype.startsWithAnyOfIgnoreCase=function(){var E=L.apply(P,arguments);return E.length===0?er(this):tt(this,function(R,I){return I.some(function(z){return R.indexOf(z)===0})},E,ji)},Yt.prototype.anyOf=function(){var E,R,I=this,z=L.apply(P,arguments),q=this._cmp;try{z.sort(q)}catch{return wi(this,Ai)}return z.length===0?er(this):((E=new this.Collection(this,function(){return yt(z[0],z[z.length-1])}))._ondirectionchange=function(G){q=G==="next"?I._ascending:I._descending,z.sort(q)},R=0,E._addAlgorithm(function(G,te,re){for(var ue=G.key;0<q(ue,z[R]);)if(++R===z.length)return te(re),!1;return q(ue,z[R])===0||(te(function(){G.continue(z[R])}),!1)}),E)},Yt.prototype.notEqual=function(E){return this.inAnyRange([[-1/0,E],[E,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Yt.prototype.noneOf=function(){var E=L.apply(P,arguments);if(E.length===0)return new this.Collection(this);try{E.sort(this._ascending)}catch{return wi(this,Ai)}var R=E.reduce(function(I,z){return I?I.concat([[I[I.length-1][1],z]]):[[-1/0,z]]},null);return R.push([E[E.length-1],this.db._maxKey]),this.inAnyRange(R,{includeLowers:!1,includeUppers:!1})},Yt.prototype.inAnyRange=function(E,Te){var I=this,z=this._cmp,q=this._ascending,G=this._descending,te=this._min,re=this._max;if(E.length===0)return er(this);if(!E.every(function(we){return we[0]!==void 0&&we[1]!==void 0&&q(we[0],we[1])<=0}))return wi(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",xe.InvalidArgument);var ue=!Te||Te.includeLowers!==!1,Se=Te&&Te.includeUppers===!0,he,ce=q;function pe(we,Ie){return ce(we[0],Ie[0])}try{(he=E.reduce(function(we,Ie){for(var $e=0,nt=we.length;$e<nt;++$e){var it=we[$e];if(z(Ie[0],it[1])<0&&0<z(Ie[1],it[0])){it[0]=te(it[0],Ie[0]),it[1]=re(it[1],Ie[1]);break}}return $e===nt&&we.push(Ie),we},[])).sort(pe)}catch{return wi(this,Ai)}var ge=0,de=Se?function(we){return 0<q(we,he[ge][1])}:function(we){return 0<=q(we,he[ge][1])},fe=ue?function(we){return 0<G(we,he[ge][0])}:function(we){return 0<=G(we,he[ge][0])},Ee=de,Te=new this.Collection(this,function(){return yt(he[0][0],he[he.length-1][1],!ue,!Se)});return Te._ondirectionchange=function(we){ce=we==="next"?(Ee=de,q):(Ee=fe,G),he.sort(pe)},Te._addAlgorithm(function(we,Ie,$e){for(var nt,it=we.key;Ee(it);)if(++ge===he.length)return Ie($e),!1;return!de(nt=it)&&!fe(nt)||(I._cmp(it,he[ge][1])===0||I._cmp(it,he[ge][0])===0||Ie(function(){ce===q?we.continue(he[ge][0]):we.continue(he[ge][1])}),!1)}),Te},Yt.prototype.startsWithAnyOf=function(){var E=L.apply(P,arguments);return E.every(function(R){return typeof R=="string"})?E.length===0?er(this):this.inAnyRange(E.map(function(R){return[R,R+ji]})):wi(this,"startsWithAnyOf() only works with strings")};var rn=Yt;function Yt(){}function ti(E){return ut(function(R){return us(R),E(R.target.error),!1})}function us(E){E.stopPropagation&&E.stopPropagation(),E.preventDefault&&E.preventDefault()}var Os="storagemutated",aa="x-storagemutated-1",Ti=sa(null,Os),yu=(Hi.prototype._lock=function(){return C(!et.global),++this._reculock,this._reculock!==1||et.global||(et.lockOwnerFor=this),this},Hi.prototype._unlock=function(){if(C(!et.global),--this._reculock==0)for(et.global||(et.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var E=this._blockedFuncs.shift();try{Qi(E[1],E[0])}catch{}}return this},Hi.prototype._locked=function(){return this._reculock&&et.lockOwnerFor!==this},Hi.prototype.create=function(E){var R=this;if(this.mode){var I=this.db.idbdb,z=this.db._state.dbOpenError;if(C(!this.idbtrans),!E&&!I)switch(z&&z.name){case"DatabaseClosedError":throw new xe.DatabaseClosed(z);case"MissingAPIError":throw new xe.MissingAPI(z.message,z);default:throw new xe.OpenFailed(z)}if(!this.active)throw new xe.TransactionInactive;C(this._completion._state===null),(E=this.idbtrans=E||(this.db.core||I).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ut(function(q){us(q),R._reject(E.error)}),E.onabort=ut(function(q){us(q),R.active&&R._reject(new xe.Abort(E.error)),R.active=!1,R.on("abort").fire(q)}),E.oncomplete=ut(function(){R.active=!1,R._resolve(),"mutatedParts"in E&&Ti.storagemutated.fire(E.mutatedParts)})}return this},Hi.prototype._promise=function(E,R,I){var z,q=this;return E==="readwrite"&&this.mode!=="readwrite"?En(new xe.ReadOnly("Transaction is readonly")):this.active?this._locked()?new rt(function(G,te){q._blockedFuncs.push([function(){q._promise(E,R,I).then(G,te)},et])}):I?Mn(function(){var G=new rt(function(te,re){q._lock();var ue=R(te,re,q);ue&&ue.then&&ue.then(te,re)});return G.finally(function(){return q._unlock()}),G._lib=!0,G}):((z=new rt(function(G,te){var re=R(G,te,q);re&&re.then&&re.then(G,te)}))._lib=!0,z):En(new xe.TransactionInactive)},Hi.prototype._root=function(){return this.parent?this.parent._root():this},Hi.prototype.waitFor=function(E){var R,I=this._root(),z=rt.resolve(E),q=(I._waitingFor?I._waitingFor=I._waitingFor.then(function(){return z}):(I._waitingFor=z,I._waitingQueue=[],R=I.idbtrans.objectStore(I.storeNames[0]),(function G(){for(++I._spinCount;I._waitingQueue.length;)I._waitingQueue.shift()();I._waitingFor&&(R.get(-1/0).onsuccess=G)})()),I._waitingFor);return new rt(function(G,te){z.then(function(re){return I._waitingQueue.push(ut(G.bind(null,re)))},function(re){return I._waitingQueue.push(ut(te.bind(null,re)))}).finally(function(){I._waitingFor===q&&(I._waitingFor=null)})})},Hi.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new xe.Abort))},Hi.prototype.table=function(E){var R=this._memoizedTables||(this._memoizedTables={});if(f(R,E))return R[E];var I=this.schema[E];if(I)return(I=new this.db.Table(E,I,this)).core=this.db.core.table(E),R[E]=I;throw new xe.NotFound("Table "+E+" not part of transaction")},Hi);function Hi(){}function Hr(E,R,I,z,q,G,te,re){return{name:E,keyPath:R,unique:I,multi:z,auto:q,compound:G,src:(I&&!te?"&":"")+(z?"*":"")+(q?"++":"")+Ll(R),type:re}}function Ll(E){return typeof E=="string"?E:E?"["+[].join.call(E,"+")+"]":""}function $a(E,R,I){return{name:E,primKey:R,indexes:I,mappedClass:null,idxByName:(z=function(q){return[q.name,q]},I.reduce(function(q,G,te){return G=z(G,te),G&&(q[G[0]]=G[1]),q},{}))};var z}var Ga=function(E){try{return E.only([[]]),Ga=function(){return[[]]},[[]]}catch{return Ga=function(){return ji},ji}};function Ka(E){return E==null?function(){}:typeof E=="string"?(R=E).split(".").length===1?function(I){return I[R]}:function(I){return M(I,R)}:function(I){return M(I,E)};var R}function qo(E){return[].slice.call(E)}var fd=0;function di(E){return E==null?":id":typeof E=="string"?E:"[".concat(E.join("+"),"]")}function oa(E,R,ue){function z(de){if(de.type===3)return null;if(de.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ce=de.lower,pe=de.upper,ge=de.lowerOpen,de=de.upperOpen;return ce===void 0?pe===void 0?null:R.upperBound(pe,!!de):pe===void 0?R.lowerBound(ce,!!ge):R.bound(ce,pe,!!ge,!!de)}function q(he){var ce,pe=he.name;return{name:pe,schema:he,mutate:function(ge){var de=ge.trans,fe=ge.type,Ee=ge.keys,Te=ge.values,we=ge.range;return new Promise(function(Ie,$e){Ie=ut(Ie);var nt=de.objectStore(pe),it=nt.keyPath==null,Ge=fe==="put"||fe==="add";if(!Ge&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var pt,ct=(Ee||Te||{length:1}).length;if(Ee&&Te&&Ee.length!==Te.length)throw new Error("Given keys array must have same length as given values array.");if(ct===0)return Ie({numFailures:0,failures:{},results:[],lastResult:void 0});function Ke(Rn){++sn,us(Rn)}var mt=[],Ut=[],sn=0;if(fe==="deleteRange"){if(we.type===4)return Ie({numFailures:sn,failures:Ut,results:[],lastResult:void 0});we.type===3?mt.push(pt=nt.clear()):mt.push(pt=nt.delete(z(we)))}else{var it=Ge?it?[Te,Ee]:[Te,null]:[Ee,null],At=it[0],Wt=it[1];if(Ge)for(var Dn=0;Dn<ct;++Dn)mt.push(pt=Wt&&Wt[Dn]!==void 0?nt[fe](At[Dn],Wt[Dn]):nt[fe](At[Dn])),pt.onerror=Ke;else for(Dn=0;Dn<ct;++Dn)mt.push(pt=nt[fe](At[Dn])),pt.onerror=Ke}function Vi(Rn){Rn=Rn.target.result,mt.forEach(function(Ls,eo){return Ls.error!=null&&(Ut[eo]=Ls.error)}),Ie({numFailures:sn,failures:Ut,results:fe==="delete"?Ee:mt.map(function(Ls){return Ls.result}),lastResult:Rn})}pt.onerror=function(Rn){Ke(Rn),Vi(Rn)},pt.onsuccess=Vi})},getMany:function(ge){var de=ge.trans,fe=ge.keys;return new Promise(function(Ee,Te){Ee=ut(Ee);for(var we,Ie=de.objectStore(pe),$e=fe.length,nt=new Array($e),it=0,Ge=0,pt=function(mt){mt=mt.target,nt[mt._pos]=mt.result,++Ge===it&&Ee(nt)},ct=ti(Te),Ke=0;Ke<$e;++Ke)fe[Ke]!=null&&((we=Ie.get(fe[Ke]))._pos=Ke,we.onsuccess=pt,we.onerror=ct,++it);it===0&&Ee(nt)})},get:function(ge){var de=ge.trans,fe=ge.key;return new Promise(function(Ee,Te){Ee=ut(Ee);var we=de.objectStore(pe).get(fe);we.onsuccess=function(Ie){return Ee(Ie.target.result)},we.onerror=ti(Te)})},query:(ce=re,function(ge){return new Promise(function(de,fe){de=ut(de);var Ee,Te,we,Ge=ge.trans,Ie=ge.values,$e=ge.limit,it=ge.query,nt=$e===1/0?void 0:$e,pt=it.index,it=it.range,Ge=Ge.objectStore(pe),Ge=pt.isPrimaryKey?Ge:Ge.index(pt.name),pt=z(it);if($e===0)return de({result:[]});ce?((it=Ie?Ge.getAll(pt,nt):Ge.getAllKeys(pt,nt)).onsuccess=function(ct){return de({result:ct.target.result})},it.onerror=ti(fe)):(Ee=0,Te=!Ie&&"openKeyCursor"in Ge?Ge.openKeyCursor(pt):Ge.openCursor(pt),we=[],Te.onsuccess=function(ct){var Ke=Te.result;return!Ke||(we.push(Ie?Ke.value:Ke.primaryKey),++Ee===$e)?de({result:we}):void Ke.continue()},Te.onerror=ti(fe))})}),openCursor:function(ge){var de=ge.trans,fe=ge.values,Ee=ge.query,Te=ge.reverse,we=ge.unique;return new Promise(function(Ie,$e){Ie=ut(Ie);var Ge=Ee.index,nt=Ee.range,it=de.objectStore(pe),it=Ge.isPrimaryKey?it:it.index(Ge.name),Ge=Te?we?"prevunique":"prev":we?"nextunique":"next",pt=!fe&&"openKeyCursor"in it?it.openKeyCursor(z(nt),Ge):it.openCursor(z(nt),Ge);pt.onerror=ti($e),pt.onsuccess=ut(function(ct){var Ke,mt,Ut,sn,At=pt.result;At?(At.___id=++fd,At.done=!1,Ke=At.continue.bind(At),mt=(mt=At.continuePrimaryKey)&&mt.bind(At),Ut=At.advance.bind(At),sn=function(){throw new Error("Cursor not stopped")},At.trans=de,At.stop=At.continue=At.continuePrimaryKey=At.advance=function(){throw new Error("Cursor not started")},At.fail=ut($e),At.next=function(){var Wt=this,Dn=1;return this.start(function(){return Dn--?Wt.continue():Wt.stop()}).then(function(){return Wt})},At.start=function(Wt){function Dn(){if(pt.result)try{Wt()}catch(Rn){At.fail(Rn)}else At.done=!0,At.start=function(){throw new Error("Cursor behind last entry")},At.stop()}var Vi=new Promise(function(Rn,Ls){Rn=ut(Rn),pt.onerror=ti(Ls),At.fail=Ls,At.stop=function(eo){At.stop=At.continue=At.continuePrimaryKey=At.advance=sn,Rn(eo)}});return pt.onsuccess=ut(function(Rn){pt.onsuccess=Dn,Dn()}),At.continue=Ke,At.continuePrimaryKey=mt,At.advance=Ut,Dn(),Vi},Ie(At)):Ie(null)},$e)})},count:function(ge){var de=ge.query,fe=ge.trans,Ee=de.index,Te=de.range;return new Promise(function(we,Ie){var $e=fe.objectStore(pe),$e=Ee.isPrimaryKey?$e:$e.index(Ee.name),nt=z(Te),nt=nt?$e.count(nt):$e.count();nt.onsuccess=ut(function(it){return we(it.target.result)}),nt.onerror=ti(Ie)})}}}G=ue,te=qo((ue=E).objectStoreNames);var G,ue={schema:{name:ue.name,tables:te.map(function(he){return G.objectStore(he)}).map(function(he){var ce=he.keyPath,pe=he.autoIncrement,de=o(ce),ge={},de={name:he.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ce==null,compound:de,keyPath:ce,autoIncrement:pe,unique:!0,extractKey:Ka(ce)},indexes:qo(he.indexNames).map(function(fe){return he.index(fe)}).map(function(we){var Ie=we.name,Ee=we.unique,Te=we.multiEntry,we=we.keyPath,Ie={name:Ie,compound:o(we),keyPath:we,unique:Ee,multiEntry:Te,extractKey:Ka(we)};return ge[di(we)]=Ie}),getIndexByKeyPath:function(fe){return ge[di(fe)]}};return ge[":id"]=de.primaryKey,ce!=null&&(ge[di(ce)]=de.primaryKey),de})},hasGetAll:0<te.length&&"getAll"in G.objectStore(te[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},te=ue.schema,re=ue.hasGetAll,ue=te.tables.map(q),Se={};return ue.forEach(function(he){return Se[he.name]=he}),{stack:"dbcore",transaction:E.transaction.bind(E),table:function(he){if(Se[he])return Se[he];throw new Error("Table '".concat(he,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Ga(R),schema:te}}function Bl(E,R,I,z){return I=I.IDBKeyRange,R=oa(R,I,z),{dbcore:E.dbcore.reduce(function(q,G){return G=G.create,i(i({},q),G(q))},R)}}function Ns(E,R){var I=R.db,I=Bl(E._middlewares,I,E._deps,R);E.core=I.dbcore,E.tables.forEach(function(z){var q=z.name;E.core.schema.tables.some(function(G){return G.name===q})&&(z.core=E.core.table(q),E[q]instanceof E.Table)&&(E[q].core=z.core)})}function zl(E,R,I,z){I.forEach(function(q){var G=z[q];R.forEach(function(te){var re=(function ue(Se,he){return v(Se,he)||(Se=h(Se))&&ue(Se,he)})(te,q);(!re||"value"in re&&re.value===void 0)&&(te===E.Transaction.prototype||te instanceof E.Transaction?_(te,q,{get:function(){return this.table(q)},set:function(ue){g(this,q,{value:ue,writable:!0,configurable:!0,enumerable:!0})}}):te[q]=new E.Table(q,G))})})}function Vo(E,R){R.forEach(function(I){for(var z in I)I[z]instanceof E.Table&&delete I[z]})}function _u(E,R){return E._cfg.version-R._cfg.version}function Wo(E,R,I,z){var q=E._dbSchema,G=(I.objectStoreNames.contains("$meta")&&!q.$meta&&(q.$meta=$a("$meta",md("")[0],[]),E._storeNames.push("$meta")),E._createTransaction("readwrite",E._storeNames,q)),te=(G.create(I),G._completion.catch(z),G._reject.bind(G)),re=et.transless||et;Mn(function(){if(et.trans=G,et.transless=re,R!==0)return Ns(E,I),Se=R,((ue=G).storeNames.includes("$meta")?ue.table("$meta").get("version").then(function(he){return he??Se}):rt.resolve(Se)).then(function(Ee){var ce=E,pe=Ee,ge=G,de=I,fe=[],Ee=ce._versions,Te=ce._dbSchema=Ya(0,ce.idbdb,de);return(Ee=Ee.filter(function(we){return we._cfg.version>=pe})).length===0?rt.resolve():(Ee.forEach(function(we){fe.push(function(){var Ie,$e,nt,it=Te,Ge=we._cfg.dbschema,pt=(Ul(ce,it,de),Ul(ce,Ge,de),Te=ce._dbSchema=Ge,Fl(it,Ge)),ct=(pt.add.forEach(function(Ke){bu(de,Ke[0],Ke[1].primKey,Ke[1].indexes)}),pt.change.forEach(function(Ke){if(Ke.recreate)throw new xe.Upgrade("Not yet support for changing primary key");var mt=de.objectStore(Ke.name);Ke.add.forEach(function(Ut){return jl(mt,Ut)}),Ke.change.forEach(function(Ut){mt.deleteIndex(Ut.name),jl(mt,Ut)}),Ke.del.forEach(function(Ut){return mt.deleteIndex(Ut)})}),we._cfg.contentUpgrade);if(ct&&we._cfg.version>pe)return Ns(ce,de),ge._memoizedTables={},Ie=N(Ge),pt.del.forEach(function(Ke){Ie[Ke]=it[Ke]}),Vo(ce,[ce.Transaction.prototype]),zl(ce,[ce.Transaction.prototype],l(Ie),Ie),ge.schema=Ie,($e=F(ct))&&Qn(),Ge=rt.follow(function(){var Ke;(nt=ct(ge))&&$e&&(Ke=Di.bind(null,null),nt.then(Ke,Ke))}),nt&&typeof nt.then=="function"?rt.resolve(nt):Ge.then(function(){return nt})}),fe.push(function(Ie){var $e,nt,it=we._cfg.dbschema;$e=it,nt=Ie,[].slice.call(nt.db.objectStoreNames).forEach(function(Ge){return $e[Ge]==null&&nt.db.deleteObjectStore(Ge)}),Vo(ce,[ce.Transaction.prototype]),zl(ce,[ce.Transaction.prototype],ce._storeNames,ce._dbSchema),ge.schema=ce._dbSchema}),fe.push(function(Ie){ce.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(ce.idbdb.version/10)===we._cfg.version?(ce.idbdb.deleteObjectStore("$meta"),delete ce._dbSchema.$meta,ce._storeNames=ce._storeNames.filter(function($e){return $e!=="$meta"})):Ie.objectStore("$meta").put(we._cfg.version,"version"))})}),(function we(){return fe.length?rt.resolve(fe.shift()(ge.idbtrans)).then(we):rt.resolve()})().then(function(){pd(Te,de)}))}).catch(te);var ue,Se;l(q).forEach(function(he){bu(I,he,q[he].primKey,q[he].indexes)}),Ns(E,I),rt.follow(function(){return E.on.populate.fire(G)}).catch(te)})}function Pl(E,R){pd(E._dbSchema,R),R.db.version%10!=0||R.objectStoreNames.contains("$meta")||R.db.createObjectStore("$meta").add(Math.ceil(R.db.version/10-1),"version");var I=Ya(0,E.idbdb,R);Ul(E,E._dbSchema,R);for(var z=0,q=Fl(I,E._dbSchema).change;z<q.length;z++){var G=(te=>{if(te.change.length||te.recreate)return console.warn("Unable to patch indexes of table ".concat(te.name," because it has changes on the type of index or primary key.")),{value:void 0};var re=R.objectStore(te.name);te.add.forEach(function(ue){Tt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(te.name,".").concat(ue.src)),jl(re,ue)})})(q[z]);if(typeof G=="object")return G.value}}function Fl(E,R){var I,z={del:[],add:[],change:[]};for(I in E)R[I]||z.del.push(I);for(I in R){var q=E[I],G=R[I];if(q){var te={name:I,def:G,recreate:!1,del:[],add:[],change:[]};if(""+(q.primKey.keyPath||"")!=""+(G.primKey.keyPath||"")||q.primKey.auto!==G.primKey.auto)te.recreate=!0,z.change.push(te);else{var re=q.idxByName,ue=G.idxByName,Se=void 0;for(Se in re)ue[Se]||te.del.push(Se);for(Se in ue){var he=re[Se],ce=ue[Se];he?he.src!==ce.src&&te.change.push(ce):te.add.push(ce)}(0<te.del.length||0<te.add.length||0<te.change.length)&&z.change.push(te)}}else z.add.push([I,G])}return z}function bu(E,R,I,z){var q=E.db.createObjectStore(R,I.keyPath?{keyPath:I.keyPath,autoIncrement:I.auto}:{autoIncrement:I.auto});z.forEach(function(G){return jl(q,G)})}function pd(E,R){l(E).forEach(function(I){R.db.objectStoreNames.contains(I)||(Tt&&console.debug("Dexie: Creating missing table",I),bu(R,I,E[I].primKey,E[I].indexes))})}function jl(E,R){E.createIndex(R.name,R.keyPath,{unique:R.unique,multiEntry:R.multi})}function Ya(E,R,I){var z={};return S(R.objectStoreNames,0).forEach(function(q){for(var G=I.objectStore(q),te=Hr(Ll(Se=G.keyPath),Se||"",!0,!1,!!G.autoIncrement,Se&&typeof Se!="string",!0),re=[],ue=0;ue<G.indexNames.length;++ue){var he=G.index(G.indexNames[ue]),Se=he.keyPath,he=Hr(he.name,Se,!!he.unique,!!he.multiEntry,!1,Se&&typeof Se!="string",!1);re.push(he)}z[q]=$a(q,te,re)}),z}function Ul(E,R,I){for(var z=I.db.objectStoreNames,q=0;q<z.length;++q){var G=z[q],te=I.objectStore(G);E._hasGetAll="getAll"in te;for(var re=0;re<te.indexNames.length;++re){var ue,Se=te.indexNames[re],he=te.index(Se).keyPath,he=typeof he=="string"?he:"["+S(he).join("+")+"]";R[G]&&(ue=R[G].idxByName[he])&&(ue.name=Se,delete R[G].idxByName[he],R[G].idxByName[Se]=ue)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(E._hasGetAll=!1)}function md(E){return E.split(",").map(function(R,I){var q=R.split(":"),z=(z=q[1])==null?void 0:z.trim(),q=(R=q[0].trim()).replace(/([&*]|\+\+)/g,""),G=/^\[/.test(q)?q.match(/^\[(.*)\]$/)[1].split("+"):q;return Hr(q,G||null,/\&/.test(R),/\*/.test(R),/\+\+/.test(R),o(G),I===0,z)})}Xa.prototype._createTableSchema=$a,Xa.prototype._parseIndexSyntax=md,Xa.prototype._parseStoresSpec=function(E,R){var I=this;l(E).forEach(function(z){if(E[z]!==null){var q=I._parseIndexSyntax(E[z]),G=q.shift();if(!G)throw new xe.Schema("Invalid schema for table "+z+": "+E[z]);if(G.unique=!0,G.multi)throw new xe.Schema("Primary key cannot be multiEntry*");q.forEach(function(te){if(te.auto)throw new xe.Schema("Only primary key can be marked as autoIncrement (++)");if(!te.keyPath)throw new xe.Schema("Index must have a name and cannot be an empty string")}),G=I._createTableSchema(z,G,q),R[z]=G}})},Xa.prototype.stores=function(I){var R=this.db,I=(this._cfg.storesSource=this._cfg.storesSource?u(this._cfg.storesSource,I):I,R._versions),z={},q={};return I.forEach(function(G){u(z,G._cfg.storesSource),q=G._cfg.dbschema={},G._parseStoresSpec(z,q)}),R._dbSchema=q,Vo(R,[R._allTables,R,R.Transaction.prototype]),zl(R,[R._allTables,R,R.Transaction.prototype,this._cfg.tables],l(q),q),R._storeNames=l(q),this},Xa.prototype.upgrade=function(E){return this._cfg.contentUpgrade=St(this._cfg.contentUpgrade||De,E),this};var km=Xa;function Xa(){}function vu(E,R){var I=E._dbNamesDB;return I||(I=E._dbNamesDB=new qr(jr,{addons:[],indexedDB:E,IDBKeyRange:R})).version(1).stores({dbnames:"name"}),I.table("dbnames")}function Hl(E){return E&&typeof E.databases=="function"}function xu(E){return Mn(function(){return et.letThrough=!0,E()})}function Su(E){return!("from"in E)}var Mi=function(E,R){var I;if(!this)return I=new Mi,E&&"d"in E&&u(I,E),I;u(this,arguments.length?{d:1,from:E,to:1<arguments.length?R:E}:{d:0})};function $o(E,R,I){var z=Dt(R,I);if(!isNaN(z)){if(0<z)throw RangeError();if(Su(E))return u(E,{from:R,to:I,d:1});var z=E.l,q=E.r;if(Dt(I,E.from)<0)return z?$o(z,R,I):E.l={from:R,to:I,d:1,l:null,r:null},yd(E);if(0<Dt(R,E.to))return q?$o(q,R,I):E.r={from:R,to:I,d:1,l:null,r:null},yd(E);Dt(R,E.from)<0&&(E.from=R,E.l=null,E.d=q?q.d+1:1),0<Dt(I,E.to)&&(E.to=I,E.r=null,E.d=E.l?E.l.d+1:1),R=!E.r,z&&!E.l&&la(E,z),q&&R&&la(E,q)}}function la(E,R){Su(R)||(function I(z,q){var G=q.from,te=q.l,re=q.r;$o(z,G,q.to),te&&I(z,te),re&&I(z,re)})(E,R)}function gd(E,R){var I=ql(R),z=I.next();if(!z.done)for(var q=z.value,G=ql(E),te=G.next(q.from),re=te.value;!z.done&&!te.done;){if(Dt(re.from,q.to)<=0&&0<=Dt(re.to,q.from))return!0;Dt(q.from,re.from)<0?q=(z=I.next(re.from)).value:re=(te=G.next(q.from)).value}return!1}function ql(E){var R=Su(E)?null:{s:0,n:E};return{next:function(I){for(var z=0<arguments.length;R;)switch(R.s){case 0:if(R.s=1,z)for(;R.n.l&&Dt(I,R.n.from)<0;)R={up:R,n:R.n.l,s:1};else for(;R.n.l;)R={up:R,n:R.n.l,s:1};case 1:if(R.s=2,!z||Dt(I,R.n.to)<=0)return{value:R.n,done:!1};case 2:if(R.n.r){R.s=3,R={up:R,n:R.n.r,s:0};continue}case 3:R=R.up}return{done:!0}}}}function yd(E){var R,I,z,q=(((q=E.r)==null?void 0:q.d)||0)-(((q=E.l)==null?void 0:q.d)||0),q=1<q?"r":q<-1?"l":"";q&&(R=q=="r"?"l":"r",I=i({},E),z=E[q],E.from=z.from,E.to=z.to,E[q]=z[q],I[q]=z[R],(E[R]=I).d=wu(I)),E.d=wu(E)}function wu(I){var R=I.r,I=I.l;return(R?I?Math.max(R.d,I.d):R.d:I?I.d:0)+1}function Vl(E,R){return l(R).forEach(function(I){E[I]?la(E[I],R[I]):E[I]=(function z(q){var G,te,re={};for(G in q)f(q,G)&&(te=q[G],re[G]=!te||typeof te!="object"||Y.has(te.constructor)?te:z(te));return re})(R[I])}),E}function Cu(E,R){return E.all||R.all||Object.keys(E).some(function(I){return R[I]&&gd(R[I],E[I])})}m(Mi.prototype,((_e={add:function(E){return la(this,E),this},addKey:function(E){return $o(this,E,E),this},addKeys:function(E){var R=this;return E.forEach(function(I){return $o(R,I,I)}),this},hasKey:function(E){var R=ql(this).next(E).value;return R&&Dt(R.from,E)<=0&&0<=Dt(R.to,E)}})[Z]=function(){return ql(this)},_e));var ca={},Eu={},ku=!1;function Wl(E){Vl(Eu,E),ku||(ku=!0,setTimeout(function(){ku=!1,Au(Eu,!(Eu={}))},0))}function Au(E,R){R===void 0&&(R=!1);var I=new Set;if(E.all)for(var z=0,q=Object.values(ca);z<q.length;z++)_d(re=q[z],E,I,R);else for(var G in E){var te,re,G=/^idb\:\/\/(.*)\/(.*)\//.exec(G);G&&(te=G[1],G=G[2],re=ca["idb://".concat(te,"/").concat(G)])&&_d(re,E,I,R)}I.forEach(function(ue){return ue()})}function _d(E,R,I,z){for(var q=[],G=0,te=Object.entries(E.queries.query);G<te.length;G++){for(var re=te[G],ue=re[0],Se=[],he=0,ce=re[1];he<ce.length;he++){var pe=ce[he];Cu(R,pe.obsSet)?pe.subscribers.forEach(function(Ee){return I.add(Ee)}):z&&Se.push(pe)}z&&q.push([ue,Se])}if(z)for(var ge=0,de=q;ge<de.length;ge++){var fe=de[ge],ue=fe[0],Se=fe[1];E.queries.query[ue]=Se}}function Am(E){var R=E._state,I=E._deps.indexedDB;if(R.isBeingOpened||E.idbdb)return R.dbReadyPromise.then(function(){return R.dbOpenError?En(R.dbOpenError):E});R.isBeingOpened=!0,R.dbOpenError=null,R.openComplete=!1;var z=R.openCanceller,q=Math.round(10*E.verno),G=!1;function te(){if(R.openCanceller!==z)throw new xe.DatabaseClosed("db.open() was cancelled")}function re(){return new rt(function(pe,ge){if(te(),!I)throw new xe.MissingAPI;var de=E.name,fe=R.autoSchema||!q?I.open(de):I.open(de,q);if(!fe)throw new xe.MissingAPI;fe.onerror=ti(ge),fe.onblocked=ut(E._fireOnBlocked),fe.onupgradeneeded=ut(function(Ee){var Te;he=fe.transaction,R.autoSchema&&!E._options.allowEmptyDB?(fe.onerror=us,he.abort(),fe.result.close(),(Te=I.deleteDatabase(de)).onsuccess=Te.onerror=ut(function(){ge(new xe.NoSuchDatabase("Database ".concat(de," doesnt exist")))})):(he.onerror=ti(ge),Te=Ee.oldVersion>Math.pow(2,62)?0:Ee.oldVersion,ce=Te<1,E.idbdb=fe.result,G&&Pl(E,he),Wo(E,Te/10,he,ge))},ge),fe.onsuccess=ut(function(){he=null;var Ee,Te,we,Ie,$e,nt,it=E.idbdb=fe.result,Ge=S(it.objectStoreNames);if(0<Ge.length)try{var pt=it.transaction(($e=Ge).length===1?$e[0]:$e,"readonly");if(R.autoSchema)nt=it,Ie=pt,(we=E).verno=nt.version/10,Ie=we._dbSchema=Ya(0,nt,Ie),we._storeNames=S(nt.objectStoreNames,0),zl(we,[we._allTables],l(Ie),Ie);else if(Ul(E,E._dbSchema,pt),Te=pt,((Te=Fl(Ya(0,(Ee=E).idbdb,Te),Ee._dbSchema)).add.length||Te.change.some(function(ct){return ct.add.length||ct.change.length}))&&!G)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),it.close(),q=it.version+1,G=!0,pe(re());Ns(E,pt)}catch{}as.push(E),it.onversionchange=ut(function(ct){R.vcFired=!0,E.on("versionchange").fire(ct)}),it.onclose=ut(function(){E.close({disableAutoOpen:!1})}),ce&&(Ge=E._deps,$e=de,Hl(nt=Ge.indexedDB)||$e===jr||vu(nt,Ge.IDBKeyRange).put({name:$e}).catch(De)),pe()},ge)}).catch(function(pe){switch(pe?.name){case"UnknownError":if(0<R.PR1398_maxLoop)return R.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),re();break;case"VersionError":if(0<q)return q=0,re()}return rt.reject(pe)})}var ue,Se=R.dbReadyResolve,he=null,ce=!1;return rt.race([z,(typeof navigator>"u"?rt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(pe){function ge(){return indexedDB.databases().finally(pe)}ue=setInterval(ge,100),ge()}).finally(function(){return clearInterval(ue)}):Promise.resolve()).then(re)]).then(function(){return te(),R.onReadyBeingFired=[],rt.resolve(xu(function(){return E.on.ready.fire(E.vip)})).then(function pe(){var ge;if(0<R.onReadyBeingFired.length)return ge=R.onReadyBeingFired.reduce(St,De),R.onReadyBeingFired=[],rt.resolve(xu(function(){return ge(E.vip)})).then(pe)})}).finally(function(){R.openCanceller===z&&(R.onReadyBeingFired=null,R.isBeingOpened=!1)}).catch(function(pe){R.dbOpenError=pe;try{he&&he.abort()}catch{}return z===R.openCanceller&&E._close(),En(pe)}).finally(function(){R.openComplete=!0,Se()}).then(function(){var pe;return ce&&(pe={},E.tables.forEach(function(ge){ge.schema.indexes.forEach(function(de){de.name&&(pe["idb://".concat(E.name,"/").concat(ge.name,"/").concat(de.name)]=new Mi(-1/0,[[[]]]))}),pe["idb://".concat(E.name,"/").concat(ge.name,"/")]=pe["idb://".concat(E.name,"/").concat(ge.name,"/:dels")]=new Mi(-1/0,[[[]]])}),Ti(Os).fire(pe),Au(pe,!0)),E})}function Go(E){function R(G){return E.next(G)}var I=q(R),z=q(function(G){return E.throw(G)});function q(G){return function(re){var re=G(re),ue=re.value;return re.done?ue:ue&&typeof ue.then=="function"?ue.then(I,z):o(ue)?Promise.all(ue).then(I,z):I(ue)}}return q(R)()}function Ds(E,R,I){for(var z=o(E)?E.slice():[E],q=0;q<I;++q)z.push(R);return z}var Tm={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(E){return i(i({},E),{table:function(z){var I=E.table(z),z=I.schema,q={},G=[];function te(pe,ge,de){var we=di(pe),fe=q[we]=q[we]||[],Ee=pe==null?0:typeof pe=="string"?1:pe.length,Te=0<ge,we=i(i({},de),{name:Te?"".concat(we,"(virtual-from:").concat(de.name,")"):de.name,lowLevelIndex:de,isVirtual:Te,keyTail:ge,keyLength:Ee,extractKey:Ka(pe),unique:!Te&&de.unique});return fe.push(we),we.isPrimaryKey||G.push(we),1<Ee&&te(Ee===2?pe[0]:pe.slice(0,Ee-1),ge+1,de),fe.sort(function(Ie,$e){return Ie.keyTail-$e.keyTail}),we}var re=te(z.primaryKey.keyPath,0,z.primaryKey);q[":id"]=[re];for(var ue=0,Se=z.indexes;ue<Se.length;ue++){var he=Se[ue];te(he.keyPath,0,he)}function ce(pe){var ge,de=pe.query.index;return de.isVirtual?i(i({},pe),{query:{index:de.lowLevelIndex,range:(ge=pe.query.range,de=de.keyTail,{type:ge.type===1?2:ge.type,lower:Ds(ge.lower,ge.lowerOpen?E.MAX_KEY:E.MIN_KEY,de),lowerOpen:!0,upper:Ds(ge.upper,ge.upperOpen?E.MIN_KEY:E.MAX_KEY,de),upperOpen:!0})}}):pe}return i(i({},I),{schema:i(i({},z),{primaryKey:re,indexes:G,getIndexByKeyPath:function(pe){return(pe=q[di(pe)])&&pe[0]}}),count:function(pe){return I.count(ce(pe))},query:function(pe){return I.query(ce(pe))},openCursor:function(pe){var ge=pe.query.index,de=ge.keyTail,fe=ge.keyLength;return ge.isVirtual?I.openCursor(ce(pe)).then(function(Te){return Te&&Ee(Te)}):I.openCursor(pe);function Ee(Te){return Object.create(Te,{continue:{value:function(we){we!=null?Te.continue(Ds(we,pe.reverse?E.MAX_KEY:E.MIN_KEY,de)):pe.unique?Te.continue(Te.key.slice(0,fe).concat(pe.reverse?E.MIN_KEY:E.MAX_KEY,de)):Te.continue()}},continuePrimaryKey:{value:function(we,Ie){Te.continuePrimaryKey(Ds(we,E.MAX_KEY,de),Ie)}},primaryKey:{get:function(){return Te.primaryKey}},key:{get:function(){var we=Te.key;return fe===1?we[0]:we.slice(0,fe)}},value:{get:function(){return Te.value}}})}}})}})}};function $l(E,R,I,z){return I=I||{},z=z||"",l(E).forEach(function(q){var G,te,re;f(R,q)?(G=E[q],te=R[q],typeof G=="object"&&typeof te=="object"&&G&&te?(re=Q(G))!==Q(te)?I[z+q]=R[q]:re==="Object"?$l(G,te,I,z+q+"."):G!==te&&(I[z+q]=R[q]):G!==te&&(I[z+q]=R[q])):I[z+q]=void 0}),l(R).forEach(function(q){f(E,q)||(I[z+q]=R[q])}),I}function Gl(E,R){return R.type==="delete"?R.keys:R.keys||R.values.map(E.extractKey)}var bd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(E){return i(i({},E),{table:function(R){var I=E.table(R),z=I.schema.primaryKey;return i(i({},I),{mutate:function(q){var G=et.trans,te=G.table(R).hook,re=te.deleting,ue=te.creating,Se=te.updating;switch(q.type){case"add":if(ue.fire===De)break;return G._promise("readwrite",function(){return he(q)},!0);case"put":if(ue.fire===De&&Se.fire===De)break;return G._promise("readwrite",function(){return he(q)},!0);case"delete":if(re.fire===De)break;return G._promise("readwrite",function(){return he(q)},!0);case"deleteRange":if(re.fire===De)break;return G._promise("readwrite",function(){return(function ce(pe,ge,de){return I.query({trans:pe,values:!1,query:{index:z,range:ge},limit:de}).then(function(fe){var Ee=fe.result;return he({type:"delete",keys:Ee,trans:pe}).then(function(Te){return 0<Te.numFailures?Promise.reject(Te.failures[0]):Ee.length<de?{failures:[],numFailures:0,lastResult:void 0}:ce(pe,i(i({},ge),{lower:Ee[Ee.length-1],lowerOpen:!0}),de)})})})(q.trans,q.range,1e4)},!0)}return I.mutate(q);function he(ce){var pe,ge,de,fe=et.trans,Ee=ce.keys||Gl(z,ce);if(Ee)return(ce=ce.type==="add"||ce.type==="put"?i(i({},ce),{keys:Ee}):i({},ce)).type!=="delete"&&(ce.values=r([],ce.values)),ce.keys&&(ce.keys=r([],ce.keys)),pe=I,de=Ee,((ge=ce).type==="add"?Promise.resolve([]):pe.getMany({trans:ge.trans,keys:de,cache:"immutable"})).then(function(Te){var we=Ee.map(function(Ie,$e){var nt,it,Ge,pt=Te[$e],ct={onerror:null,onsuccess:null};return ce.type==="delete"?re.fire.call(ct,Ie,pt,fe):ce.type==="add"||pt===void 0?(nt=ue.fire.call(ct,Ie,ce.values[$e],fe),Ie==null&&nt!=null&&(ce.keys[$e]=Ie=nt,z.outbound||D(ce.values[$e],z.keyPath,Ie))):(nt=$l(pt,ce.values[$e]),(it=Se.fire.call(ct,nt,Ie,pt,fe))&&(Ge=ce.values[$e],Object.keys(it).forEach(function(Ke){f(Ge,Ke)?Ge[Ke]=it[Ke]:D(Ge,Ke,it[Ke])}))),ct});return I.mutate(ce).then(function(Ie){for(var $e=Ie.failures,nt=Ie.results,it=Ie.numFailures,Ie=Ie.lastResult,Ge=0;Ge<Ee.length;++Ge){var pt=(nt||Ee)[Ge],ct=we[Ge];pt==null?ct.onerror&&ct.onerror($e[Ge]):ct.onsuccess&&ct.onsuccess(ce.type==="put"&&Te[Ge]?ce.values[Ge]:pt)}return{failures:$e,results:nt,numFailures:it,lastResult:Ie}}).catch(function(Ie){return we.forEach(function($e){return $e.onerror&&$e.onerror(Ie)}),Promise.reject(Ie)})});throw new Error("Keys missing")}}})}})}};function Tu(E,R,I){try{if(!R||R.keys.length<E.length)return null;for(var z=[],q=0,G=0;q<R.keys.length&&G<E.length;++q)Dt(R.keys[q],E[G])===0&&(z.push(I?H(R.values[q]):R.values[q]),++G);return z.length===E.length?z:null}catch{return null}}var vd={stack:"dbcore",level:-1,create:function(E){return{table:function(R){var I=E.table(R);return i(i({},I),{getMany:function(z){var q;return z.cache?(q=Tu(z.keys,z.trans._cache,z.cache==="clone"))?rt.resolve(q):I.getMany(z).then(function(G){return z.trans._cache={keys:z.keys,values:z.cache==="clone"?H(G):G},G}):I.getMany(z)},mutate:function(z){return z.type!=="add"&&(z.trans._cache=null),I.mutate(z)}})}}}};function ua(E,R){return E.trans.mode==="readonly"&&!!E.subscr&&!E.trans.explicit&&E.trans.db._options.cache!=="disabled"&&!R.schema.primaryKey.outbound}function xd(E,R){switch(E){case"query":return R.values&&!R.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Mm={stack:"dbcore",level:0,name:"Observability",create:function(E){var R=E.schema.name,I=new Mi(E.MIN_KEY,E.MAX_KEY);return i(i({},E),{transaction:function(z,q,G){if(et.subscr&&q!=="readonly")throw new xe.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(et.querier));return E.transaction(z,q,G)},table:function(z){function q(Ee){var fe,Ee=Ee.query;return[fe=Ee.index,new Mi((fe=(Ee=Ee.range).lower)!=null?fe:E.MIN_KEY,(fe=Ee.upper)!=null?fe:E.MAX_KEY)]}var G=E.table(z),te=G.schema,re=te.primaryKey,ue=te.indexes,Se=re.extractKey,he=re.outbound,ce=re.autoIncrement&&ue.filter(function(de){return de.compound&&de.keyPath.includes(re.keyPath)}),pe=i(i({},G),{mutate:function(de){function fe(mt){return mt="idb://".concat(R,"/").concat(z,"/").concat(mt),$e[mt]||($e[mt]=new Mi)}var Ee,Te,we,Ie=de.trans,$e=de.mutatedParts||(de.mutatedParts={}),nt=fe(""),it=fe(":dels"),Ge=de.type,ct=de.type==="deleteRange"?[de.range]:de.type==="delete"?[de.keys]:de.values.length<50?[Gl(re,de).filter(function(mt){return mt}),de.values]:[],pt=ct[0],ct=ct[1],Ke=de.trans._cache;return o(pt)?(nt.addKeys(pt),(Ge=Ge==="delete"||pt.length===ct.length?Tu(pt,Ke):null)||it.addKeys(pt),(Ge||ct)&&(Ee=fe,Te=Ge,we=ct,te.indexes.forEach(function(mt){var Ut=Ee(mt.name||"");function sn(Wt){return Wt!=null?mt.extractKey(Wt):null}function At(Wt){mt.multiEntry&&o(Wt)?Wt.forEach(function(Dn){return Ut.addKey(Dn)}):Ut.addKey(Wt)}(Te||we).forEach(function(Wt,Rn){var Vi=Te&&sn(Te[Rn]),Rn=we&&sn(we[Rn]);Dt(Vi,Rn)!==0&&(Vi!=null&&At(Vi),Rn!=null)&&At(Rn)})}))):pt?(ct={from:(Ke=pt.lower)!=null?Ke:E.MIN_KEY,to:(Ge=pt.upper)!=null?Ge:E.MAX_KEY},it.add(ct),nt.add(ct)):(nt.add(I),it.add(I),te.indexes.forEach(function(mt){return fe(mt.name).add(I)})),G.mutate(de).then(function(mt){return!pt||de.type!=="add"&&de.type!=="put"||(nt.addKeys(mt.results),ce&&ce.forEach(function(Ut){for(var sn=de.values.map(function(Vi){return Ut.extractKey(Vi)}),At=Ut.keyPath.findIndex(function(Vi){return Vi===re.keyPath}),Wt=0,Dn=mt.results.length;Wt<Dn;++Wt)sn[Wt][At]=mt.results[Wt];fe(Ut.name).addKeys(sn)})),Ie.mutatedParts=Vl(Ie.mutatedParts||{},$e),mt})}}),ge={get:function(de){return[re,new Mi(de.key)]},getMany:function(de){return[re,new Mi().addKeys(de.keys)]},count:q,query:q,openCursor:q};return l(ge).forEach(function(de){pe[de]=function(fe){var Ee=et.subscr,Te=!!Ee,we=ua(et,G)&&xd(de,fe)?fe.obsSet={}:Ee;if(Te){var Ie,Ee=function(ct){return ct="idb://".concat(R,"/").concat(z,"/").concat(ct),we[ct]||(we[ct]=new Mi)},$e=Ee(""),nt=Ee(":dels"),Te=ge[de](fe),it=Te[0],Te=Te[1];if((de==="query"&&it.isPrimaryKey&&!fe.values?nt:Ee(it.name||"")).add(Te),!it.isPrimaryKey){if(de!=="count")return Ie=de==="query"&&he&&fe.values&&G.query(i(i({},fe),{values:!1})),G[de].apply(this,arguments).then(function(ct){if(de==="query"){if(he&&fe.values)return Ie.then(function(sn){return sn=sn.result,$e.addKeys(sn),ct});var Ke=fe.values?ct.result.map(Se):ct.result;(fe.values?$e:nt).addKeys(Ke)}else{var mt,Ut;if(de==="openCursor")return Ut=fe.values,(mt=ct)&&Object.create(mt,{key:{get:function(){return nt.addKey(mt.primaryKey),mt.key}},primaryKey:{get:function(){var sn=mt.primaryKey;return nt.addKey(sn),sn}},value:{get:function(){return Ut&&$e.addKey(mt.primaryKey),mt.value}}})}return ct});nt.add(I)}}return G[de].apply(this,arguments)}}),pe}})}};function Sd(E,R,I){var z;return I.numFailures===0?R:R.type==="deleteRange"||(z=R.keys?R.keys.length:"values"in R&&R.values?R.values.length:1,I.numFailures===z)?null:(z=i({},R),o(z.keys)&&(z.keys=z.keys.filter(function(q,G){return!(G in I.failures)})),"values"in z&&o(z.values)&&(z.values=z.values.filter(function(q,G){return!(G in I.failures)})),z)}function Kl(E,R){return I=E,((z=R).lower===void 0||(z.lowerOpen?0<Dt(I,z.lower):0<=Dt(I,z.lower)))&&(I=E,(z=R).upper===void 0||(z.upperOpen?Dt(I,z.upper)<0:Dt(I,z.upper)<=0));var I,z}function Mu(E,R,I,z,q,G){var te,re,ue,Se,he,ce;return!I||I.length===0||(te=R.query.index,re=te.multiEntry,ue=R.query.range,Se=z.schema.primaryKey.extractKey,he=te.extractKey,ce=(te.lowLevelIndex||te).extractKey,(z=I.reduce(function(pe,ge){var de=pe,fe=[];if(ge.type==="add"||ge.type==="put")for(var Ee=new Mi,Te=ge.values.length-1;0<=Te;--Te){var we,Ie=ge.values[Te],$e=Se(Ie);!Ee.hasKey($e)&&(we=he(Ie),re&&o(we)?we.some(function(ct){return Kl(ct,ue)}):Kl(we,ue))&&(Ee.addKey($e),fe.push(Ie))}switch(ge.type){case"add":var nt=new Mi().addKeys(R.values?pe.map(function(Ke){return Se(Ke)}):pe),de=pe.concat(R.values?fe.filter(function(Ke){return Ke=Se(Ke),!nt.hasKey(Ke)&&(nt.addKey(Ke),!0)}):fe.map(function(Ke){return Se(Ke)}).filter(function(Ke){return!nt.hasKey(Ke)&&(nt.addKey(Ke),!0)}));break;case"put":var it=new Mi().addKeys(ge.values.map(function(Ke){return Se(Ke)}));de=pe.filter(function(Ke){return!it.hasKey(R.values?Se(Ke):Ke)}).concat(R.values?fe:fe.map(function(Ke){return Se(Ke)}));break;case"delete":var Ge=new Mi().addKeys(ge.keys);de=pe.filter(function(Ke){return!Ge.hasKey(R.values?Se(Ke):Ke)});break;case"deleteRange":var pt=ge.range;de=pe.filter(function(Ke){return!Kl(Se(Ke),pt)})}return de},E))===E)?E:(z.sort(function(pe,ge){return Dt(ce(pe),ce(ge))||Dt(Se(pe),Se(ge))}),R.limit&&R.limit<1/0&&(z.length>R.limit?z.length=R.limit:E.length===R.limit&&z.length<R.limit&&(q.dirty=!0)),G?Object.freeze(z):z)}function Za(E,R){return Dt(E.lower,R.lower)===0&&Dt(E.upper,R.upper)===0&&!!E.lowerOpen==!!R.lowerOpen&&!!E.upperOpen==!!R.upperOpen}function Ko(E,R){return((I,z,q,G)=>{if(I===void 0)return z!==void 0?-1:0;if(z===void 0)return 1;if((I=Dt(I,z))===0){if(q&&G)return 0;if(q)return 1;if(G)return-1}return I})(E.lower,R.lower,E.lowerOpen,R.lowerOpen)<=0&&0<=((I,z,q,G)=>{if(I===void 0)return z!==void 0?1:0;if(z===void 0)return-1;if((I=Dt(I,z))===0){if(q&&G)return 0;if(q)return-1;if(G)return 1}return I})(E.upper,R.upper,E.upperOpen,R.upperOpen)}function Rm(E,R,I,z){E.subscribers.add(I),z.addEventListener("abort",function(){var q,G;E.subscribers.delete(I),E.subscribers.size===0&&(q=E,G=R,setTimeout(function(){q.subscribers.size===0&&ne(G,q)},3e3))})}var Yl={stack:"dbcore",level:0,name:"Cache",create:function(E){var R=E.schema.name;return i(i({},E),{transaction:function(I,z,q){var G,te,re=E.transaction(I,z,q);return z==="readwrite"&&(q=(G=new AbortController).signal,re.addEventListener("abort",(te=function(ue){return function(){if(G.abort(),z==="readwrite"){for(var Se=new Set,he=0,ce=I;he<ce.length;he++){var pe=ce[he],ge=ca["idb://".concat(R,"/").concat(pe)];if(ge){var de=E.table(pe),fe=ge.optimisticOps.filter(function(mt){return mt.trans===re});if(re._explicit&&ue&&re.mutatedParts)for(var Ee=0,Te=Object.values(ge.queries.query);Ee<Te.length;Ee++)for(var we=0,Ie=(it=Te[Ee]).slice();we<Ie.length;we++)Cu((Ge=Ie[we]).obsSet,re.mutatedParts)&&(ne(it,Ge),Ge.subscribers.forEach(function(mt){return Se.add(mt)}));else if(0<fe.length){ge.optimisticOps=ge.optimisticOps.filter(function(mt){return mt.trans!==re});for(var $e=0,nt=Object.values(ge.queries.query);$e<nt.length;$e++)for(var it,Ge,pt,ct=0,Ke=(it=nt[$e]).slice();ct<Ke.length;ct++)(Ge=Ke[ct]).res!=null&&re.mutatedParts&&(ue&&!Ge.dirty?(pt=Object.isFrozen(Ge.res),pt=Mu(Ge.res,Ge.req,fe,de,Ge,pt),Ge.dirty?(ne(it,Ge),Ge.subscribers.forEach(function(mt){return Se.add(mt)})):pt!==Ge.res&&(Ge.res=pt,Ge.promise=rt.resolve({result:pt}))):(Ge.dirty&&ne(it,Ge),Ge.subscribers.forEach(function(mt){return Se.add(mt)})))}}}Se.forEach(function(mt){return mt()})}}})(!1),{signal:q}),re.addEventListener("error",te(!1),{signal:q}),re.addEventListener("complete",te(!0),{signal:q})),re},table:function(I){var z=E.table(I),q=z.schema.primaryKey;return i(i({},z),{mutate:function(G){var te,re=et.trans;return!q.outbound&&re.db._options.cache!=="disabled"&&!re.explicit&&re.idbtrans.mode==="readwrite"&&(te=ca["idb://".concat(R,"/").concat(I)])?(re=z.mutate(G),G.type!=="add"&&G.type!=="put"||!(50<=G.values.length||Gl(q,G).some(function(ue){return ue==null}))?(te.optimisticOps.push(G),G.mutatedParts&&Wl(G.mutatedParts),re.then(function(ue){0<ue.numFailures&&(ne(te.optimisticOps,G),(ue=Sd(0,G,ue))&&te.optimisticOps.push(ue),G.mutatedParts)&&Wl(G.mutatedParts)}),re.catch(function(){ne(te.optimisticOps,G),G.mutatedParts&&Wl(G.mutatedParts)})):re.then(function(ue){var Se=Sd(0,i(i({},G),{values:G.values.map(function(he,ce){var pe;return ue.failures[ce]?he:(D(pe=(pe=q.keyPath)!=null&&pe.includes(".")?H(he):i({},he),q.keyPath,ue.results[ce]),pe)})}),ue);te.optimisticOps.push(Se),queueMicrotask(function(){return G.mutatedParts&&Wl(G.mutatedParts)})}),re):z.mutate(G)},query:function(G){var te,re,ue,Se,he,ce,pe;return ua(et,z)&&xd("query",G)?(te=((ue=et.trans)==null?void 0:ue.db._options.cache)==="immutable",re=(ue=et).requery,ue=ue.signal,ce=((ge,de,fe,Ee)=>{var Te=ca["idb://".concat(ge,"/").concat(de)];if(!Te)return[];if(!(ge=Te.queries[fe]))return[null,!1,Te,null];var we=ge[(Ee.query?Ee.query.index.name:null)||""];if(!we)return[null,!1,Te,null];switch(fe){case"query":var Ie=we.find(function($e){return $e.req.limit===Ee.limit&&$e.req.values===Ee.values&&Za($e.req.query.range,Ee.query.range)});return Ie?[Ie,!0,Te,we]:[we.find(function($e){return("limit"in $e.req?$e.req.limit:1/0)>=Ee.limit&&(!Ee.values||$e.req.values)&&Ko($e.req.query.range,Ee.query.range)}),!1,Te,we];case"count":return Ie=we.find(function($e){return Za($e.req.query.range,Ee.query.range)}),[Ie,!!Ie,Te,we]}})(R,I,"query",G),pe=ce[0],Se=ce[2],he=ce[3],pe&&ce[1]?pe.obsSet=G.obsSet:(ce=z.query(G).then(function(ge){var de=ge.result;if(pe&&(pe.res=de),te){for(var fe=0,Ee=de.length;fe<Ee;++fe)Object.freeze(de[fe]);Object.freeze(de)}else ge.result=H(de);return ge}).catch(function(ge){return he&&pe&&ne(he,pe),Promise.reject(ge)}),pe={obsSet:G.obsSet,promise:ce,subscribers:new Set,type:"query",req:G,dirty:!1},he?he.push(pe):(he=[pe],(Se=Se||(ca["idb://".concat(R,"/").concat(I)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[G.query.index.name||""]=he)),Rm(pe,he,re,ue),pe.promise.then(function(ge){return{result:Mu(ge.result,G,Se?.optimisticOps,z,pe,te)}})):z.query(G)}})}})}};function Yo(E,R){return new Proxy(E,{get:function(I,z,q){return z==="db"?R:Reflect.get(I,z,q)}})}Wn.prototype.version=function(E){if(isNaN(E)||E<.1)throw new xe.Type("Given version is not a positive number");if(E=Math.round(10*E)/10,this.idbdb||this._state.isBeingOpened)throw new xe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,E);var R=this._versions,I=R.filter(function(z){return z._cfg.version===E})[0];return I||(I=new this.Version(E),R.push(I),R.sort(_u),I.stores({}),this._state.autoSchema=!1),I},Wn.prototype._whenReady=function(E){var R=this;return this.idbdb&&(this._state.openComplete||et.letThrough||this._vip)?E():new rt(function(I,z){if(R._state.openComplete)return z(new xe.DatabaseClosed(R._state.dbOpenError));if(!R._state.isBeingOpened){if(!R._state.autoOpen)return void z(new xe.DatabaseClosed);R.open().catch(De)}R._state.dbReadyPromise.then(I,z)}).then(E)},Wn.prototype.use=function(q){var R=q.stack,I=q.create,z=q.level,q=q.name,G=(q&&this.unuse({stack:R,name:q}),this._middlewares[R]||(this._middlewares[R]=[]));return G.push({stack:R,create:I,level:z??10,name:q}),G.sort(function(te,re){return te.level-re.level}),this},Wn.prototype.unuse=function(E){var R=E.stack,I=E.name,z=E.create;return R&&this._middlewares[R]&&(this._middlewares[R]=this._middlewares[R].filter(function(q){return z?q.create!==z:!!I&&q.name!==I})),this},Wn.prototype.open=function(){var E=this;return Qi(Vn,function(){return Am(E)})},Wn.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var E=this._state,R=as.indexOf(this);if(0<=R&&as.splice(R,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}E.isBeingOpened||(E.dbReadyPromise=new rt(function(I){E.dbReadyResolve=I}),E.openCanceller=new rt(function(I,z){E.cancelOpen=z}))},Wn.prototype.close=function(R){var R=(R===void 0?{disableAutoOpen:!0}:R).disableAutoOpen,I=this._state;R?(I.isBeingOpened&&I.cancelOpen(new xe.DatabaseClosed),this._close(),I.autoOpen=!1,I.dbOpenError=new xe.DatabaseClosed):(this._close(),I.autoOpen=this._options.autoOpen||I.isBeingOpened,I.openComplete=!1,I.dbOpenError=null)},Wn.prototype.delete=function(E){var R=this,I=(E===void 0&&(E={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),z=this._state;return new rt(function(q,G){function te(){R.close(E);var re=R._deps.indexedDB.deleteDatabase(R.name);re.onsuccess=ut(function(){var ue,Se,he;ue=R._deps,Se=R.name,Hl(he=ue.indexedDB)||Se===jr||vu(he,ue.IDBKeyRange).delete(Se).catch(De),q()}),re.onerror=ti(G),re.onblocked=R._fireOnBlocked}if(I)throw new xe.InvalidArgument("Invalid closeOptions argument to db.delete()");z.isBeingOpened?z.dbReadyPromise.then(te):te()})},Wn.prototype.backendDB=function(){return this.idbdb},Wn.prototype.isOpen=function(){return this.idbdb!==null},Wn.prototype.hasBeenClosed=function(){var E=this._state.dbOpenError;return E&&E.name==="DatabaseClosed"},Wn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Wn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Wn.prototype,"tables",{get:function(){var E=this;return l(this._allTables).map(function(R){return E._allTables[R]})},enumerable:!1,configurable:!0}),Wn.prototype.transaction=function(){var E=(function(R,I,z){var q=arguments.length;if(q<2)throw new xe.InvalidArgument("Too few arguments");for(var G=new Array(q-1);--q;)G[q-1]=arguments[q];return z=G.pop(),[R,U(G),z]}).apply(this,arguments);return this._transaction.apply(this,E)},Wn.prototype._transaction=function(E,R,I){var z,q,G=this,te=et.trans,re=(te&&te.db===this&&E.indexOf("!")===-1||(te=null),E.indexOf("?")!==-1);E=E.replace("!","").replace("?","");try{if(q=R.map(function(Se){if(Se=Se instanceof G.Table?Se.name:Se,typeof Se!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Se}),E=="r"||E===vr)z=vr;else{if(E!="rw"&&E!=Xe)throw new xe.InvalidArgument("Invalid transaction mode: "+E);z=Xe}if(te){if(te.mode===vr&&z===Xe){if(!re)throw new xe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");te=null}te&&q.forEach(function(Se){if(te&&te.storeNames.indexOf(Se)===-1){if(!re)throw new xe.SubTransaction("Table "+Se+" not included in parent transaction.");te=null}}),re&&te&&!te.active&&(te=null)}}catch(Se){return te?te._promise(null,function(he,ce){ce(Se)}):En(Se)}var ue=(function Se(he,ce,pe,ge,de){return rt.resolve().then(function(){var we=et.transless||et,fe=he._createTransaction(ce,pe,he._dbSchema,ge),we=(fe.explicit=!0,{trans:fe,transless:we});if(ge)fe.idbtrans=ge.idbtrans;else try{fe.create(),fe.idbtrans._explicit=!0,he._state.PR1398_maxLoop=3}catch(Ie){return Ie.name===ee.InvalidState&&he.isOpen()&&0<--he._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),he.close({disableAutoOpen:!1}),he.open().then(function(){return Se(he,ce,pe,null,de)})):En(Ie)}var Ee,Te=F(de),we=(Te&&Qn(),rt.follow(function(){var Ie;(Ee=de.call(fe,fe))&&(Te?(Ie=Di.bind(null,null),Ee.then(Ie,Ie)):typeof Ee.next=="function"&&typeof Ee.throw=="function"&&(Ee=Go(Ee)))},we));return(Ee&&typeof Ee.then=="function"?rt.resolve(Ee).then(function(Ie){return fe.active?Ie:En(new xe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):we.then(function(){return Ee})).then(function(Ie){return ge&&fe._resolve(),fe._completion.then(function(){return Ie})}).catch(function(Ie){return fe._reject(Ie),En(Ie)})})}).bind(null,this,z,q,te,I);return te?te._promise(z,ue,"lock"):et.trans?Qi(et.transless,function(){return G._whenReady(ue)}):this._whenReady(ue)},Wn.prototype.table=function(E){if(f(this._allTables,E))return this._allTables[E];throw new xe.InvalidTable("Table ".concat(E," does not exist"))};var qr=Wn;function Wn(E,R){var I,z,q,G,te,re=this,ue=(this._middlewares={},this.verno=0,Wn.dependencies),ue=(this._options=R=i({addons:Wn.addons,autoOpen:!0,indexedDB:ue.indexedDB,IDBKeyRange:ue.IDBKeyRange,cache:"cloned"},R),this._deps={indexedDB:R.indexedDB,IDBKeyRange:R.IDBKeyRange},R.addons),Se=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:De,dbReadyPromise:null,cancelOpen:De,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:R.autoOpen}),he=(Se.dbReadyPromise=new rt(function(ce){Se.dbReadyResolve=ce}),Se.openCanceller=new rt(function(ce,pe){Se.cancelOpen=pe}),this._state=Se,this.name=E,this.on=sa(this,"populate","blocked","versionchange","close",{ready:[St,De]}),this.once=function(ce,pe){var ge=function(){for(var de=[],fe=0;fe<arguments.length;fe++)de[fe]=arguments[fe];re.on(ce).unsubscribe(ge),pe.apply(re,de)};return re.on(ce,ge)},this.on.ready.subscribe=b(this.on.ready.subscribe,function(ce){return function(pe,ge){Wn.vip(function(){var de,fe=re._state;fe.openComplete?(fe.dbOpenError||rt.resolve().then(pe),ge&&ce(pe)):fe.onReadyBeingFired?(fe.onReadyBeingFired.push(pe),ge&&ce(pe)):(ce(pe),de=re,ge||ce(function Ee(){de.on.ready.unsubscribe(pe),de.on.ready.unsubscribe(Ee)}))})}}),this.Collection=(I=this,hi(Il.prototype,function(Ee,fe){this.db=I;var ge=Jt,de=null;if(fe)try{ge=fe()}catch(we){de=we}var fe=Ee._ctx,Ee=fe.table,Te=Ee.hook.reading.fire;this._ctx={table:Ee,index:fe.index,isPrimKey:!fe.index||Ee.schema.primKey.keyPath&&fe.index===Ee.schema.primKey.name,range:ge,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:de,or:fe.or,valueMapper:Te!==wt?Te:null}})),this.Table=(z=this,hi(Wa.prototype,function(ce,pe,ge){this.db=z,this._tx=ge,this.name=ce,this.schema=pe,this.hook=z._allTables[ce]?z._allTables[ce].hook:sa(null,{creating:[ze,De],reading:[Fe,wt],updating:[at,De],deleting:[Ue,De]})})),this.Transaction=(q=this,hi(yu.prototype,function(ce,pe,ge,de,fe){var Ee=this;ce!=="readonly"&&pe.forEach(function(Te){Te=(Te=ge[Te])==null?void 0:Te.yProps,Te&&(pe=pe.concat(Te.map(function(we){return we.updatesTable})))}),this.db=q,this.mode=ce,this.storeNames=pe,this.schema=ge,this.chromeTransactionDurability=de,this.idbtrans=null,this.on=sa(this,"complete","error","abort"),this.parent=fe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new rt(function(Te,we){Ee._resolve=Te,Ee._reject=we}),this._completion.then(function(){Ee.active=!1,Ee.on.complete.fire()},function(Te){var we=Ee.active;return Ee.active=!1,Ee.on.error.fire(Te),Ee.parent?Ee.parent._reject(Te):we&&Ee.idbtrans&&Ee.idbtrans.abort(),En(Te)})})),this.Version=(G=this,hi(km.prototype,function(ce){this.db=G,this._cfg={version:ce,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(te=this,hi(rn.prototype,function(ce,pe,ge){if(this.db=te,this._ctx={table:ce,index:pe===":id"?null:pe,or:ge},this._cmp=this._ascending=Dt,this._descending=function(de,fe){return Dt(fe,de)},this._max=function(de,fe){return 0<Dt(de,fe)?de:fe},this._min=function(de,fe){return Dt(de,fe)<0?de:fe},this._IDBKeyRange=te._deps.IDBKeyRange,!this._IDBKeyRange)throw new xe.MissingAPI})),this.on("versionchange",function(ce){0<ce.newVersion?console.warn("Another connection wants to upgrade database '".concat(re.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(re.name,"'. Closing db now to resume the delete request.")),re.close({disableAutoOpen:!1})}),this.on("blocked",function(ce){!ce.newVersion||ce.newVersion<ce.oldVersion?console.warn("Dexie.delete('".concat(re.name,"') was blocked")):console.warn("Upgrade '".concat(re.name,"' blocked by other connection holding version ").concat(ce.oldVersion/10))}),this._maxKey=Ga(R.IDBKeyRange),this._createTransaction=function(ce,pe,ge,de){return new re.Transaction(ce,pe,ge,re._options.chromeTransactionDurability,de)},this._fireOnBlocked=function(ce){re.on("blocked").fire(ce),as.filter(function(pe){return pe.name===re.name&&pe!==re&&!pe._state.vcFired}).map(function(pe){return pe.on("versionchange").fire(ce)})},this.use(vd),this.use(Yl),this.use(Mm),this.use(Tm),this.use(bd),new Proxy(this,{get:function(ce,pe,ge){var de;return pe==="_vip"||(pe==="table"?function(fe){return Yo(re.table(fe),he)}:(de=Reflect.get(ce,pe,ge))instanceof Wa?Yo(de,he):pe==="tables"?de.map(function(fe){return Yo(fe,he)}):pe==="_createTransaction"?function(){return Yo(de.apply(this,arguments),he)}:de)}}));this.vip=he,ue.forEach(function(ce){return ce(re)})}var Ja,ha=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",wd=(Xl.prototype.subscribe=function(E,R,I){return this._subscribe(E&&typeof E!="function"?E:{next:E,error:R,complete:I})},Xl.prototype[ha]=function(){return this},Xl);function Xl(E){this._subscribe=E}try{Ja={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{Ja={indexedDB:null,IDBKeyRange:null}}function Cd(E){var R,I=!1,z=new wd(function(q){var G=F(E),te,re=!1,ue={},Se={},he={get closed(){return re},unsubscribe:function(){re||(re=!0,te&&te.abort(),ce&&Ti.storagemutated.unsubscribe(ge))}},ce=(q.start&&q.start(he),!1),pe=function(){return xi(de)},ge=function(fe){Vl(ue,fe),Cu(Se,ue)&&pe()},de=function(){var fe,Ee,Te;!re&&Ja.indexedDB&&(ue={},fe={},te&&te.abort(),te=new AbortController,Te=(we=>{var Ie=_n();try{G&&Qn();var $e=Mn(E,we);return $e=G?$e.finally(Di):$e}finally{Ie&&fn()}})(Ee={subscr:fe,signal:te.signal,requery:pe,querier:E,trans:null}),Promise.resolve(Te).then(function(we){I=!0,R=we,re||Ee.signal.aborted||(ue={},(Ie=>{for(var $e in Ie)if(f(Ie,$e))return;return 1})(Se=fe)||ce||(Ti(Os,ge),ce=!0),xi(function(){return!re&&q.next&&q.next(we)}))},function(we){I=!1,["DatabaseClosedError","AbortError"].includes(we?.name)||re||xi(function(){re||q.error&&q.error(we)})}))};return setTimeout(pe,0),he});return z.hasValue=function(){return I},z.getValue=function(){return R},z}var da=qr;function Ru(E){var R=Is;try{Is=!0,Ti.storagemutated.fire(E),Au(E,!0)}finally{Is=R}}m(da,i(i({},$),{delete:function(E){return new da(E,{addons:[]}).delete()},exists:function(E){return new da(E,{addons:[]}).open().then(function(R){return R.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(E){try{return R=da.dependencies,I=R.indexedDB,R=R.IDBKeyRange,(Hl(I)?Promise.resolve(I.databases()).then(function(z){return z.map(function(q){return q.name}).filter(function(q){return q!==jr})}):vu(I,R).toCollection().primaryKeys()).then(E)}catch{return En(new xe.MissingAPI)}var R,I},defineClass:function(){return function(E){u(this,E)}},ignoreTransaction:function(E){return et.trans?Qi(et.transless,E):E()},vip:xu,async:function(E){return function(){try{var R=Go(E.apply(this,arguments));return R&&typeof R.then=="function"?R:rt.resolve(R)}catch(I){return En(I)}}},spawn:function(E,R,I){try{var z=Go(E.apply(I,R||[]));return z&&typeof z.then=="function"?z:rt.resolve(z)}catch(q){return En(q)}},currentTransaction:{get:function(){return et.trans||null}},waitFor:function(E,R){return E=rt.resolve(typeof E=="function"?da.ignoreTransaction(E):E).timeout(R||6e4),et.trans?et.trans.waitFor(E):E},Promise:rt,debug:{get:function(){return Tt},set:function(E){Re(E)}},derive:w,extend:u,props:m,override:b,Events:sa,on:Ti,liveQuery:Cd,extendObservabilitySet:Vl,getByKeyPath:M,setByKeyPath:D,delByKeyPath:function(E,R){typeof R=="string"?D(E,R,void 0):"length"in R&&[].map.call(R,function(I){D(E,I,void 0)})},shallowClone:N,deepClone:H,getObjectDiff:$l,cmp:Dt,asap:O,minKey:-1/0,addons:[],connections:as,errnames:ee,dependencies:Ja,cache:ca,semVer:"4.3.0",version:"4.3.0".split(".").map(function(E){return parseInt(E)}).reduce(function(E,R,I){return E+R/Math.pow(10,2*I)})})),da.maxKey=Ga(da.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ti(Os,function(E){Is||(E=new CustomEvent(aa,{detail:E}),Is=!0,dispatchEvent(E),Is=!1)}),addEventListener(aa,function(E){E=E.detail,Is||Ru(E)}));var Qa,Is=!1,qi=function(){};return typeof BroadcastChannel<"u"&&((qi=function(){(Qa=new BroadcastChannel(aa)).onmessage=function(E){return E.data&&Ru(E.data)}})(),typeof Qa.unref=="function"&&Qa.unref(),Ti(Os,function(E){Is||Qa.postMessage(E)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(E){if(!qr.disableBfCache&&E.persisted){Tt&&console.debug("Dexie: handling persisted pagehide"),Qa?.close();for(var R=0,I=as;R<I.length;R++)I[R].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(E){!qr.disableBfCache&&E.persisted&&(Tt&&console.debug("Dexie: handling persisted pageshow"),qi(),Ru({all:new Mi(-1/0,[[]])}))})),rt.rejectionMapper=function(E,R){return!E||E instanceof ye||E instanceof TypeError||E instanceof SyntaxError||!E.name||!Ze[E.name]?E:(R=new Ze[E.name](R||E.message,E),"stack"in E&&_(R,"stack",{get:function(){return this.inner.stack}}),R)},Re(Tt),i(qr,Object.freeze({__proto__:null,Dexie:qr,Entity:Yn,PropModification:Si,RangeSet:Mi,add:function(E){return new Si({add:E})},cmp:Dt,default:qr,liveQuery:Cd,mergeRanges:la,rangesOverlap:gd,remove:function(E){return new Si({remove:E})},replacePrefix:function(E,R){return new Si({replacePrefix:[E,R]})}}),{default:qr}),qr})})(Mp)),Mp.exports}var gO=mO();const t0=id(gO),AS=Symbol.for("Dexie"),zp=globalThis[AS]||(globalThis[AS]=t0);if(t0.semVer!==zp.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${t0.semVer} and ${zp.semVer}`);const{liveQuery:k$,mergeRanges:A$,rangesOverlap:T$,RangeSet:M$,cmp:R$,Entity:O$,PropModification:N$,replacePrefix:D$,add:I$,remove:L$,DexieYProvider:B$}=zp;class yO extends zp{sessions;prompts;responses;toolCalls;events;notes;promptQueue;alerts;sshProfiles;settings;summaryPrompts;teams;constructor(){super("claude-dashboard"),this.version(2).stores({sessions:"id, status, projectPath, startedAt, lastActivityAt, archived",prompts:"++id, sessionId, timestamp, [sessionId+timestamp]",responses:"++id, sessionId, timestamp, [sessionId+timestamp]",toolCalls:"++id, sessionId, timestamp, toolName, [sessionId+timestamp]",events:"++id, sessionId, timestamp, [sessionId+timestamp]",notes:"++id, sessionId",promptQueue:"++id, sessionId, [sessionId+position]",alerts:"++id, sessionId",sshProfiles:"++id, name",settings:"key",summaryPrompts:"++id, isDefault",teams:"id"})}}const Kt=new yO;async function TS(n){if(!n?.sessionId)return;const e={id:n.sessionId,projectPath:n.projectPath||"",projectName:n.projectName||"Unknown",title:n.title||"",status:n.status||"idle",model:n.model||"",source:typeof n.source=="string"?n.source:"hook",startedAt:n.startedAt||Date.now(),lastActivityAt:n.lastActivityAt||Date.now(),endedAt:n.endedAt??null,totalToolCalls:n.totalToolCalls||0,totalPrompts:n.promptHistory?.length||0,archived:n.archived||0,summary:n.summary??null,characterModel:n.characterModel??null,accentColor:n.accentColor??null,teamId:n.teamId??null,teamRole:n.teamRole??null,terminalId:n.terminalId??null,queueCount:n.queueCount||0,label:n.label??null};if(await Kt.sessions.put(e),n.promptHistory?.length){const t=await Kt.prompts.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.promptHistory.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,text:a.text,timestamp:a.timestamp}));r.length>0&&await Kt.prompts.bulkAdd(r)}if(n.toolLog?.length){const t=await Kt.toolCalls.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.toolLog.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,toolName:a.tool,toolInputSummary:a.input,timestamp:a.timestamp}));r.length>0&&await Kt.toolCalls.bulkAdd(r)}if(n.responseLog?.length){const t=await Kt.responses.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.responseLog.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,textExcerpt:a.text,timestamp:a.timestamp}));r.length>0&&await Kt.responses.bulkAdd(r)}if(n.events?.length){const t=await Kt.events.where("sessionId").equals(n.sessionId).toArray(),i=new Set(t.map(a=>a.timestamp)),r=n.events.filter(a=>!i.has(a.timestamp)).map(a=>({sessionId:n.sessionId,eventType:a.type,detail:a.detail||"",timestamp:a.timestamp}));r.length>0&&await Kt.events.bulkAdd(r)}}const WE=["prompts","responses","toolCalls","events","notes","promptQueue","alerts"];async function _O(n,e){for(const t of WE){const i=Kt.table(t),r=await i.where("sessionId").equals(n).toArray();r.length!==0&&await Kt.transaction("rw",i,async()=>{for(const a of r)await i.update(a.id,{sessionId:e})})}}async function bO(n){await Kt.sessions.delete(n);for(const e of WE){const t=Kt.table(e),r=(await t.where("sessionId").equals(n).toArray()).map(a=>a.id).filter(a=>a!=null);r.length>0&&await t.bulkDelete(r)}}const n0=new Set,bs=Tl(n=>({queues:new Map,add:(e,t)=>n(i=>{const r=new Map(i.queues),a=[...r.get(e)??[],t];return r.set(e,a),{queues:r}}),remove:(e,t)=>n(i=>{const r=new Map(i.queues),a=(r.get(e)??[]).filter(l=>l.id!==t);return r.set(e,a),{queues:r}}),reorder:(e,t)=>n(i=>{const r=new Map(i.queues),a=r.get(e)??[],l=new Map(a.map(u=>[u.id,u])),o=t.map((u,h)=>{const p=l.get(u);return p?{...p,position:h}:null}).filter(u=>u!==null);return r.set(e,o),{queues:r}}),moveToSession:(e,t,i)=>n(r=>{const a=new Map(r.queues),l=a.get(t)??[],o=[...a.get(i)??[]],u=new Set(e),h=[],p=[];for(const m of l)u.has(m.id)?h.push(m):p.push(m);let f=o.length>0?Math.max(...o.map(m=>m.position)):-1;for(const m of h)f++,o.push({...m,sessionId:i,position:f});return a.set(t,p),a.set(i,o),{queues:a}}),setQueue:(e,t)=>n(i=>{const r=new Map(i.queues);return r.set(e,t),{queues:r}}),migrateSession:(e,t)=>n(i=>{const r=i.queues.get(e);if(!r||r.length===0)return i;const a=new Map(i.queues);return a.delete(e),a.set(t,r.map(l=>({...l,sessionId:t}))),{queues:a}}),loadFromDb:async()=>{try{const e=await Kt.promptQueue.toArray();if(e.length===0)return;const t=new Map;for(const i of e){const r=t.get(i.sessionId)??[];r.push({id:i.id,sessionId:i.sessionId,text:i.text,position:i.position,createdAt:i.createdAt}),t.set(i.sessionId,r)}for(const i of t.keys())n0.add(i);for(const[i,r]of t)r.sort((a,l)=>a.position-l.position),bs.getState().setQueue(i,r);setTimeout(()=>n0.clear(),0)}catch{}}}));let Ey=new Map;bs.subscribe(n=>{const e=n.queues,t=[];for(const[i,r]of e)Ey.get(i)!==r&&t.push(i);for(const i of Ey.keys())e.has(i)||t.push(i);Ey=e;for(const i of t){if(n0.has(i))continue;const r=e.get(i)??[];vO(i,r)}});async function vO(n,e){try{const i=(await Kt.promptQueue.where("sessionId").equals(n).toArray()).map(r=>r.id).filter(r=>r!=null);i.length>0&&await Kt.promptQueue.bulkDelete(i),e.length>0&&await Kt.promptQueue.bulkAdd(e.map((r,a)=>({sessionId:n,text:r.text,position:a,createdAt:r.createdAt})))}catch{}}const i0=Tl(n=>({connected:!1,reconnecting:!1,lastSeq:0,client:null,setConnected:e=>n({connected:e}),setReconnecting:e=>n({reconnecting:e}),setLastSeq:e=>n({lastSeq:e}),setClient:e=>n({client:e})})),MS={sessionStart:"chime",sessionEnd:"cascade",promptSubmit:"ping",taskComplete:"fanfare",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"buzz",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"ding",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"chime",alert:"alarm",kill:"thud",archive:"ding",subagentStart:"chirp",subagentStop:"ping"},xO={sessionStart:"Session Start",sessionEnd:"Session End",promptSubmit:"Prompt Submit",taskComplete:"Task Complete",toolRead:"Tool: Read",toolWrite:"Tool: Write",toolEdit:"Tool: Edit",toolBash:"Tool: Bash",toolGrep:"Tool: Grep",toolGlob:"Tool: Glob",toolWebFetch:"Tool: WebFetch",toolTask:"Tool: Task",toolOther:"Tool: Other",approvalNeeded:"Approval Needed",inputNeeded:"Input Needed",alert:"Alert",kill:"Kill",archive:"Archive",subagentStart:"Subagent Start",subagentStop:"Subagent Stop"},SO=[{label:"Session Events",actions:["sessionStart","sessionEnd","promptSubmit","taskComplete"]},{label:"Tool Calls",actions:["toolRead","toolWrite","toolEdit","toolBash","toolGrep","toolGlob","toolWebFetch","toolTask","toolOther"]},{label:"System",actions:["approvalNeeded","inputNeeded","alert","kill","archive","subagentStart","subagentStop"]}];class wO{ctx=null;unlocked=!1;volume=.5;actionOverrides={};getCtx(){return this.ctx||(this.ctx=new AudioContext),this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{}),this.ctx}playTone(e,t,i="sine",r=1){const a=this.getCtx(),l=a.createOscillator(),o=a.createGain();l.type=i,l.frequency.setValueAtTime(e,a.currentTime),o.gain.setValueAtTime(r*this.volume*.3,a.currentTime),o.gain.exponentialRampToValueAtTime(.001,a.currentTime+t),l.connect(o),o.connect(a.destination),l.start(a.currentTime),l.stop(a.currentTime+t)}playSequence(e,t=.1,i=.15,r="sine"){e.forEach((a,l)=>{setTimeout(()=>this.playTone(a,i,r),l*t*1e3)})}sounds={chirp:()=>this.playTone(1200,.08,"sine"),ping:()=>this.playTone(660,.2,"sine"),chime:()=>this.playSequence([523,659,784],.08,.2),ding:()=>this.playTone(800,.25,"triangle"),blip:()=>this.playTone(880,.05,"square",.5),swoosh:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createGain();t.type="sine",t.frequency.setValueAtTime(300,e.currentTime),t.frequency.exponentialRampToValueAtTime(1200,e.currentTime+.25),i.gain.setValueAtTime(this.volume*.25,e.currentTime),i.gain.exponentialRampToValueAtTime(.001,e.currentTime+.3),t.connect(i),i.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.3)},click:()=>this.playTone(1200,.03,"square",.2),beep:()=>this.playTone(440,.15,"square",.4),warble:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createOscillator(),r=e.createGain(),a=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,e.currentTime),i.type="sine",i.frequency.setValueAtTime(12,e.currentTime),r.gain.setValueAtTime(50,e.currentTime),i.connect(r),r.connect(t.frequency),a.gain.setValueAtTime(this.volume*.25,e.currentTime),a.gain.exponentialRampToValueAtTime(.001,e.currentTime+.3),t.connect(a),a.connect(e.destination),t.start(e.currentTime),i.start(e.currentTime),t.stop(e.currentTime+.3),i.stop(e.currentTime+.3)},buzz:()=>this.playTone(200,.12,"sawtooth",.4),cascade:()=>this.playSequence([784,659,523,392],.1,.2),fanfare:()=>this.playSequence([523,659,784,1047,1319],.08,.2),alarm:()=>this.playSequence([880,660,880,660],.15,.15,"square"),thud:()=>{const e=this.getCtx(),t=e.createOscillator(),i=e.createGain();t.type="sine",t.frequency.setValueAtTime(80,e.currentTime),t.frequency.exponentialRampToValueAtTime(30,e.currentTime+.3),i.gain.setValueAtTime(this.volume*.5,e.currentTime),i.gain.exponentialRampToValueAtTime(.001,e.currentTime+.35),t.connect(i),i.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.35)},urgentAlarm:()=>{const e=this.getCtx(),t=e.currentTime;for(let i=0;i<3;i++){const r=i*.4,a=e.createOscillator(),l=e.createGain();a.type="square",a.frequency.setValueAtTime(1e3,t+r),a.frequency.setValueAtTime(800,t+r+.1),a.frequency.setValueAtTime(1e3,t+r+.2),l.gain.setValueAtTime(this.volume*.5,t+r),l.gain.setValueAtTime(this.volume*.5,t+r+.25),l.gain.exponentialRampToValueAtTime(.001,t+r+.3),a.connect(l),l.connect(e.destination),a.start(t+r),a.stop(t+r+.3);const o=e.createOscillator(),u=e.createGain();o.type="sawtooth",o.frequency.setValueAtTime(200,t+r),u.gain.setValueAtTime(this.volume*.3,t+r),u.gain.exponentialRampToValueAtTime(.001,t+r+.3),o.connect(u),u.connect(e.destination),o.start(t+r),o.stop(t+r+.3)}},none:()=>{}};unlock(){this.unlocked=!0,this.ctx?.state==="suspended"&&this.ctx.resume().catch(()=>{})}isUnlocked(){return this.unlocked}setVolume(e){this.volume=Math.max(0,Math.min(1,e))}getVolume(){return this.volume}setActionSound(e,t){this.actionOverrides={...this.actionOverrides,[e]:t}}getActionSound(e){return this.actionOverrides[e]??MS[e]??"none"}getActionSounds(){return{...MS,...this.actionOverrides}}loadOverrides(e){this.actionOverrides={...e}}getSoundNames(){return Object.keys(this.sounds)}play(e){if(!this.unlocked)return!1;const t=this.getActionSound(e),i=this.sounds[t];return i&&i(),t!=="none"}preview(e){const t=this.sounds[e];t&&t()}dispose(){this.ctx&&(this.ctx.close().catch(()=>{}),this.ctx=null),this.unlocked=!1}}const vs=new wO,CO=[{name:"command-center",label:"Command Center",colors:["#0a0a1a","#00e5ff","#ff9100"]},{name:"cyberpunk",label:"Cyberpunk",colors:["#0d0221","#ff00ff","#00ffff"]},{name:"warm",label:"Warm",colors:["#faf6f1","#d97706","#b87333"]},{name:"dracula",label:"Dracula",colors:["#282a36","#bd93f9","#50fa7b"]},{name:"solarized",label:"Solarized",colors:["#002b36","#2aa198","#cb4b16"]},{name:"nord",label:"Nord",colors:["#2e3440","#88c0d0","#d08770"]},{name:"monokai",label:"Monokai",colors:["#272822","#66d9ef","#f92672"]},{name:"light",label:"Light",colors:["#f0f2f5","#0ea5e9","#3b82f6"]},{name:"blonde",label:"Blonde",colors:["#fdf8ef","#ca8a04","#a16207"]}],kf={claude:{enabled:!0,volume:.7,actions:{sessionStart:"chime",sessionEnd:"cascade",promptSubmit:"ping",taskComplete:"fanfare",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"click",toolGrep:"click",toolGlob:"click",toolWebFetch:"ping",toolTask:"chime",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"chime",alert:"alarm",kill:"thud",archive:"ping",subagentStart:"chirp",subagentStop:"ping"}},gemini:{enabled:!0,volume:.7,actions:{sessionStart:"ding",sessionEnd:"cascade",promptSubmit:"chirp",taskComplete:"fanfare",toolRead:"click",toolWrite:"swoosh",toolEdit:"swoosh",toolBash:"ding",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"ding",toolOther:"chirp",approvalNeeded:"alarm",inputNeeded:"ding",alert:"alarm",kill:"thud",archive:"swoosh",subagentStart:"chirp",subagentStop:"ding"}},codex:{enabled:!0,volume:.5,actions:{sessionStart:"blip",sessionEnd:"beep",promptSubmit:"click",taskComplete:"blip",toolRead:"click",toolWrite:"blip",toolEdit:"blip",toolBash:"beep",toolGrep:"click",toolGlob:"click",toolWebFetch:"click",toolTask:"beep",toolOther:"click",approvalNeeded:"alarm",inputNeeded:"beep",alert:"alarm",kill:"thud",archive:"click",subagentStart:"blip",subagentStop:"beep"}},openclaw:{enabled:!0,volume:.7,actions:{sessionStart:"fanfare",sessionEnd:"cascade",promptSubmit:"buzz",taskComplete:"fanfare",toolRead:"click",toolWrite:"buzz",toolEdit:"buzz",toolBash:"buzz",toolGrep:"click",toolGlob:"click",toolWebFetch:"swoosh",toolTask:"buzz",toolOther:"buzz",approvalNeeded:"urgentAlarm",inputNeeded:"fanfare",alert:"urgentAlarm",kill:"thud",archive:"cascade",subagentStart:"fanfare",subagentStop:"cascade"}}},EO={enabled:!1,volume:.3,preset:"off",roomSounds:!1,roomVolume:.2},Co={soundSettings:{enabled:!0,volume:.5,muteApproval:!1,muteInput:!1,perCli:{claude:{...kf.claude},gemini:{...kf.gemini},codex:{...kf.codex},openclaw:{...kf.openclaw}}},ambientSettings:{...EO},labelAlarms:{labels:[],soundEnabled:!0},theme:"dark",compactMode:!1,showArchived:!1,groupBy:"none",sortBy:"activity",themeName:"command-center",fontSize:13,scanlineEnabled:!0,animationIntensity:100,animationSpeed:100,characterModel:"robot",soundActions:{},movementActions:{},hookDensity:"medium",scene3dEnabled:!0,activityFeedVisible:!0,toastEnabled:!0,autoSendQueue:!1,defaultTerminalTheme:"auto",anthropicApiKey:"",openaiApiKey:"",geminiApiKey:"",autosaveVisible:!1};function ky(n){n==="command-center"?document.body.removeAttribute("data-theme"):document.body.setAttribute("data-theme",n)}function Ay(n){document.documentElement.style.fontSize=n+"px"}function Ty(n){document.body.classList.toggle("no-scanlines",!n)}function My(n){document.documentElement.style.setProperty("--anim-intensity",String(n/100))}function Ry(n){document.documentElement.style.setProperty("--anim-speed",String(n/100))}const Gt=Tl((n,e)=>({...Co,loadFromDb:t=>{n({...t});const i=e();ky(i.themeName),Ay(i.fontSize),Ty(i.scanlineEnabled),My(i.animationIntensity),Ry(i.animationSpeed)},saveToDb:()=>({...e()}),updateSoundSettings:t=>{n(i=>({soundSettings:{...i.soundSettings,...t}})),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},updateCliSoundConfig:(t,i)=>{n(r=>{const a=r.soundSettings.perCli,l=a[t];return l?{soundSettings:{...r.soundSettings,perCli:{...a,[t]:{...l,...i}}}}:{}}),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},setCliActionSound:(t,i,r)=>{n(a=>{const l=a.soundSettings.perCli,o=l[t];return o?{soundSettings:{...a.soundSettings,perCli:{...l,[t]:{...o,actions:{...o.actions,[i]:r}}}}}:{}}),e().persistSetting("soundSettings",JSON.stringify(e().soundSettings))},updateAmbientSettings:t=>{n(i=>({ambientSettings:{...i.ambientSettings,...t}})),e().persistSetting("ambientSettings",JSON.stringify(e().ambientSettings))},updateLabelAlarms:t=>{n(i=>({labelAlarms:{...i.labelAlarms,...t}})),e().persistSetting("labelAlarms",JSON.stringify(e().labelAlarms))},setThemeName:t=>{ky(t),n({themeName:t}),e().persistSetting("themeName",t)},setTheme:t=>n({theme:t}),setFontSize:t=>{Ay(t),n({fontSize:t}),e().persistSetting("fontSize",t)},setScanlineEnabled:t=>{Ty(t),n({scanlineEnabled:t}),e().persistSetting("scanlineEnabled",t)},setAnimationIntensity:t=>{My(t),n({animationIntensity:t}),e().persistSetting("animationIntensity",t)},setAnimationSpeed:t=>{Ry(t),n({animationSpeed:t}),e().persistSetting("animationSpeed",t)},setCharacterModel:t=>{n({characterModel:t}),e().persistSetting("characterModel",t)},setHookDensity:t=>{n({hookDensity:t}),e().persistSetting("hookDensity",t)},setCompactMode:t=>n({compactMode:t}),setShowArchived:t=>n({showArchived:t}),setGroupBy:t=>n({groupBy:t}),setSortBy:t=>n({sortBy:t}),setScene3dEnabled:t=>{n({scene3dEnabled:t}),e().persistSetting("scene3dEnabled",t)},setActivityFeedVisible:t=>{n({activityFeedVisible:t}),e().persistSetting("activityFeedVisible",t)},setToastEnabled:t=>{n({toastEnabled:t}),e().persistSetting("toastEnabled",t)},setAutoSendQueue:t=>{n({autoSendQueue:t}),e().persistSetting("autoSendQueue",t)},setDefaultTerminalTheme:t=>{n({defaultTerminalTheme:t}),e().persistSetting("defaultTerminalTheme",t)},setSoundAction:(t,i)=>{n(a=>({soundActions:{...a.soundActions,[t]:i}}));const r=e().soundActions;e().persistSetting("soundActions",JSON.stringify(r))},setMovementAction:(t,i)=>{n(a=>({movementActions:{...a.movementActions,[t]:i}}));const r=e().movementActions;e().persistSetting("movementActions",JSON.stringify(r))},setApiKey:(t,i)=>{const r={anthropic:"anthropicApiKey",openai:"openaiApiKey",gemini:"geminiApiKey"};n({[r[t]]:i}),e().persistSetting(r[t],i)},persistSetting:async(t,i)=>{try{if(typeof i=="object"&&i!==null)try{JSON.stringify(i)}catch{return}await Kt.settings.put({key:t,value:i,updatedAt:Date.now()}),e().flashAutosave()}catch{}},flashAutosave:()=>{n({autosaveVisible:!0}),setTimeout(()=>n({autosaveVisible:!1}),2e3)},resetDefaults:()=>{n({...Co}),ky(Co.themeName),Ay(Co.fontSize),Ty(Co.scanlineEnabled),My(Co.animationIntensity),Ry(Co.animationSpeed);const t=e();for(const[i,r]of Object.entries(Co))typeof r!="function"&&t.persistSetting(i,typeof r=="object"?JSON.stringify(r):r)}}));function kO(n){const e=(n.model||"").toLowerCase();if(e.includes("claude")||e.includes("opus")||e.includes("sonnet")||e.includes("haiku"))return"claude";if(e.includes("gemini")||e.includes("gemma"))return"gemini";if(e.includes("gpt")||e.includes("codex")||e.includes("o1")||e.includes("o3")||e.includes("o4"))return"codex";if(e.includes("openclaw")||e.includes("claw"))return"openclaw";const t=n.events||[];return t.some(l=>l.type==="BeforeAgent"||l.type==="AfterAgent"||l.type==="BeforeTool"||l.type==="AfterTool")?"gemini":t.some(l=>l.type==="agent-turn-complete")?"codex":t.some(l=>l.type==="SessionStart"||l.type==="PreToolUse"||l.type==="PostToolUse"||l.type==="UserPromptSubmit")?"claude":null}const AO={Read:"toolRead",Write:"toolWrite",Edit:"toolEdit",Bash:"toolBash",Grep:"toolGrep",Glob:"toolGlob",WebFetch:"toolWebFetch",Task:"toolTask"},Sc=new Map,Oy=new Map,Rp=new Set;function $s(n,e){const t=Gt.getState();if(!t.soundSettings.enabled)return;const i=kO(n),r=t.soundSettings.perCli,a=i?r[i]:void 0;if(a&&a.enabled){const l=a.actions[e]??"none";if(l!=="none"){const o=vs.getVolume();vs.setVolume(t.soundSettings.volume*a.volume),vs.preview(l),vs.setVolume(o)}return}vs.play(e)}function TO(n){const e=n.events;if(!e||e.length===0||Rp.has(n.sessionId))return;const t=e[e.length-1];if(t)switch(t.type){case"SessionStart":$s(n,"sessionStart");break;case"UserPromptSubmit":$s(n,"promptSubmit");break;case"PreToolUse":{const i=t.tool_name||"",r=AO[i]||"toolOther";$s(n,r);break}case"Stop":$s(n,"taskComplete");break;case"SessionEnd":$s(n,"sessionEnd");break;case"SubagentStart":$s(n,"subagentStart");break;case"SubagentStop":$s(n,"subagentStop");break}}function MO(n,e){const t=n.sessionId;if(n.status==="approval"&&!Rp.has(t)){if(!Sc.has(t)){$s(n,"approvalNeeded");const r=setInterval(()=>{const a=e().get(t);if(!a||a.status!=="approval"||Rp.has(t)){clearInterval(r),Sc.delete(t);return}$s(a,"approvalNeeded")},1e4);Sc.set(t,r)}}else if(n.status!=="approval"&&Sc.has(t)){const r=Sc.get(t);clearInterval(r),Sc.delete(t)}const i=`input-${t}`;n.status==="input"&&!Rp.has(t)?Oy.has(i)||($s(n,"inputNeeded"),Oy.set(i,!0)):n.status!=="input"&&Oy.delete(i)}function RO(n){const e=V.useRef(null);return V.useEffect(()=>{const{addSession:t,updateSession:i,removeSession:r,setSessions:a}=yn.getState(),{setConnected:l,setReconnecting:o,setLastSeq:u}=i0.getState();function h(g){switch(g.type){case"snapshot":{const _=new Map;for(const[w,v]of Object.entries(g.sessions)){const x=v.sessionId||w,S=_.get(x);(!S||(v.lastActivityAt||0)>(S.lastActivityAt||0))&&_.set(x,v)}a(_),u(g.seq);for(const w of _.values())TS(w).catch(()=>{});Kt.sessions.toCollection().primaryKeys().then(w=>{const v=new Set(_.keys()),x=w.filter(S=>!v.has(String(S)));x.length>0&&Kt.sessions.bulkDelete(x).catch(()=>{})}).catch(()=>{});break}case"session_update":{const{session:_}=g;_.replacesId&&(bs.getState().migrateSession(_.replacesId,_.sessionId),_O(_.replacesId,_.sessionId).then(()=>Kt.sessions.delete(_.replacesId)).catch(()=>{})),i(_),TS(_).catch(()=>{}),TO(_),MO(_,()=>yn.getState().sessions);break}case"session_removed":{r(g.sessionId);break}case"clearBrowserDb":{Kt.delete().then(()=>Kt.open()).catch(()=>{});break}}}function p(g){l(g==="connected"),o(g==="reconnecting")}const{setClient:f}=i0.getState(),m=new V0({url:"/ws",token:n,onMessage:h,onStatus:p});return e.current=m,f(m),m.connect(),()=>{m.dispose(),e.current=null,f(null)}},[n]),e.current}const OO="_screen_lsklh_6",NO="_card_lsklh_12",DO="_input_lsklh_38",IO="_btn_lsklh_59",LO="_error_lsklh_80",dh={screen:OO,card:NO,input:DO,btn:IO,error:LO};function BO({onLogin:n}){const[e,t]=V.useState(""),[i,r]=V.useState(""),[a,l]=V.useState(!1),o=V.useRef(null);V.useEffect(()=>{o.current?.focus()},[]);async function u(h){if(h.preventDefault(),!e){r("Please enter a password");return}l(!0),r("");const p=await n(e);p.success||(r(p.error??"Authentication failed"),t(""),o.current?.focus()),l(!1)}return A.jsx("div",{className:dh.screen,children:A.jsxs("form",{className:dh.card,onSubmit:u,children:[A.jsx("h2",{children:"AI Agent Session Center"}),A.jsx("p",{children:"Enter password to continue"}),A.jsx("input",{ref:o,type:"password",value:e,onChange:h=>t(h.target.value),placeholder:"Password",autoComplete:"current-password",className:dh.input,disabled:a}),i&&A.jsx("p",{className:dh.error,children:i}),A.jsx("button",{type:"submit",disabled:a,className:dh.btn,children:a?"Authenticating...":"Login"})]})})}const bi=Tl(n=>({activeModal:null,detailPanelOpen:!1,activityFeedOpen:!1,openModal:e=>n({activeModal:e}),closeModal:()=>n({activeModal:null}),setDetailPanelOpen:e=>n({detailPanelOpen:e}),setActivityFeedOpen:e=>n({activityFeedOpen:e})})),zO="_overlay_12hnn_10",PO="_panel_12hnn_19",FO="_actions_12hnn_27",jO="_closeBtn_12hnn_29",UO="_alertInputRow_12hnn_33",HO="_alertInput_12hnn_33",qO="_newSessionPanel_12hnn_41",VO="_newSessionBody_12hnn_49",WO="_newSessionFooter_12hnn_60",$O="_sshField_12hnn_71",GO="_sshFieldRow_12hnn_75",KO="_sshFieldGrow_12hnn_76",YO="_sshFieldSmall_12hnn_77",XO="_sshFieldHint_12hnn_78",ZO="_sshFieldRequired_12hnn_79",JO="_sshFieldError_12hnn_80",QO="_active_12hnn_87",e3="_quickSessionPanel_12hnn_104",t3="_quickSessionHeader_12hnn_105",n3="_quickSessionBody_12hnn_107",i3="_quickSessionHint_12hnn_108",r3="_quickSessionFooter_12hnn_109",s3="_quickLabelChips_12hnn_112",a3="_quickLabelChip_12hnn_112",o3="_labelText_12hnn_116",l3="_labelDelete_12hnn_117",c3="_quickLabelEmpty_12hnn_120",u3="_quickLabelInputRow_12hnn_122",h3="_quickWorkdirRow_12hnn_126",d3="_shortcutsPanel_12hnn_133",f3="_shortcutsHeader_12hnn_134",p3="_shortcutsBody_12hnn_136",m3="_shortcutsSection_12hnn_137",g3="_shortcutList_12hnn_138",y3="_shortcutRow_12hnn_139",_3="_toastContainer_12hnn_145",b3="_toast_12hnn_145",v3="_toastMsg_12hnn_152",ht={overlay:zO,panel:PO,actions:FO,closeBtn:jO,alertInputRow:UO,alertInput:HO,newSessionPanel:qO,newSessionBody:VO,newSessionFooter:WO,sshField:$O,sshFieldRow:GO,sshFieldGrow:KO,sshFieldSmall:YO,sshFieldHint:XO,sshFieldRequired:ZO,sshFieldError:JO,active:QO,quickSessionPanel:e3,quickSessionHeader:t3,quickSessionBody:n3,quickSessionHint:i3,quickSessionFooter:r3,quickLabelChips:s3,quickLabelChip:a3,labelText:o3,labelDelete:l3,quickLabelEmpty:c3,quickLabelInputRow:u3,quickWorkdirRow:h3,shortcutsPanel:d3,shortcutsHeader:f3,shortcutsBody:p3,shortcutsSection:m3,shortcutList:g3,shortcutRow:y3,toastContainer:_3,toast:b3,toastMsg:v3};function dm({modalId:n,children:e,title:t,onClose:i,panelClassName:r}){const a=bi(m=>m.activeModal),l=bi(m=>m.closeModal),o=V.useRef(null),u=V.useRef(null),h=a===n,p=V.useCallback(()=>{l(),i?.()},[l,i]);if(V.useEffect(()=>{if(!h)return;function m(g){g.key==="Escape"&&(g.stopPropagation(),p())}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[h,p]),V.useEffect(()=>{if(!h||!u.current)return;const m=u.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),g=m[0],_=m[m.length-1];g?.focus();function w(v){if(v.key==="Tab"){if(m.length===0){v.preventDefault();return}v.shiftKey?document.activeElement===g&&(v.preventDefault(),_?.focus()):document.activeElement===_&&(v.preventDefault(),g?.focus())}}return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[h]),!h)return null;function f(m){m.target===o.current&&p()}return A.jsx("div",{ref:o,onClick:f,className:ht.overlay,children:A.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":t,className:`${ht.panel}${r?` ${r}`:""}`,children:[t&&A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[A.jsx("h3",{children:t}),A.jsx("button",{onClick:p,"aria-label":"Close",className:ht.closeBtn,children:"x"})]}),e]})})}const $E="182",z$={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},P$={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},F$=0,j$=1,U$=2,H$=3,q$=0,V$=1,W$=2,$$=3,r0=0,GE=1,G$=2,x3=0,RS=1,K$=2,Y$=3,X$=4,Z$=5,OS=100,J$=101,Q$=102,eG=103,tG=104,nG=200,iG=201,rG=202,sG=203,NS=204,DS=205,aG=206,oG=207,lG=208,cG=209,uG=210,hG=211,dG=212,fG=213,pG=214,mG=0,gG=1,yG=2,IS=3,_G=4,bG=5,vG=6,xG=7,W0=0,SG=1,wG=2,CG=0,EG=1,kG=2,AG=3,TG=4,MG=5,RG=6,OG=7,LS="attached",S3="detached",$0=300,fm=301,w3=302,C3=303,E3=304,k3=306,s0=1e3,Ks=1001,a0=1002,Br=1003,A3=1004,NG=1004,T3=1005,DG=1005,ts=1006,M3=1007,IG=1007,pm=1008,LG=1008,G0=1009,R3=1010,O3=1011,N3=1012,D3=1013,mm=1014,iu=1015,I3=1016,L3=1017,B3=1018,BG=1020,z3=35902,P3=35899,F3=1021,j3=1022,Gh=1023,o0=1026,U3=1027,KE=1028,YE=1029,H3=1030,q3=1031,zG=1032,V3=1033,W3=33776,$3=33777,G3=33778,K3=33779,Y3=35840,X3=35841,Z3=35842,J3=35843,Q3=36196,eN=37492,tN=37496,nN=37488,iN=37489,rN=37490,sN=37491,aN=37808,oN=37809,lN=37810,cN=37811,uN=37812,hN=37813,dN=37814,fN=37815,pN=37816,mN=37817,gN=37818,yN=37819,_N=37820,bN=37821,vN=36492,xN=36494,SN=36495,wN=36283,CN=36284,EN=36285,kN=36286,AN=2200,TN=2201,MN=2202,Pp=2300,l0=2301,Ny=2302,Zc=2400,Jc=2401,Fp=2402,K0=2500,XE=2501,PG=0,FG=1,jG=2,RN=3200,UG=3201,HG=3202,qG=3203,hu=0,VG=1,ZE="",Jr="srgb",BS="srgb-linear",zS="linear",Dy="srgb",WG="",$G="rg",GG="ga",KG=0,wc=7680,YG=7681,XG=7682,ZG=7683,JG=34055,QG=34056,eK=5386,tK=512,nK=513,iK=514,rK=515,sK=516,aK=517,oK=518,PS=519,lK=512,cK=513,uK=514,hK=515,dK=516,fK=517,pK=518,mK=519,jp=35044,gK=35048,yK=35040,_K=35045,bK=35049,vK=35041,xK=35046,SK=35050,wK=35042,CK="100",EK="300 es",Ys=2e3,Kh=2001,kK={COMPUTE:"compute",RENDER:"render"},AK={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},TK={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function ON(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const NN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Qc(n,e){return new NN[n](e)}function JE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Up(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function MK(){const n=Up("canvas");return n.style.display="block",n}const FS={};let Bo=null;function RK(n){Bo=n}function OK(){return Bo}function jS(...n){const e="THREE."+n.shift();Bo?Bo("log",e,...n):console.log(e,...n)}function zt(...n){const e="THREE."+n.shift();Bo?Bo("warn",e,...n):console.warn(e,...n)}function wn(...n){const e="THREE."+n.shift();Bo?Bo("error",e,...n):console.error(e,...n)}function US(...n){const e=n.join(" ");e in FS||(FS[e]=!0,zt(...n))}function NK(n,e,t){return new Promise(function(i,r){function a(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:i()}}setTimeout(a,t)})}class Po{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,e);e.target=null}}}const $i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let HS=1234567;const Cl=Math.PI/180,Yh=180/Math.PI;function Dr(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return($i[n&255]+$i[n>>8&255]+$i[n>>16&255]+$i[n>>24&255]+"-"+$i[e&255]+$i[e>>8&255]+"-"+$i[e>>16&15|64]+$i[e>>24&255]+"-"+$i[t&63|128]+$i[t>>8&255]+"-"+$i[t>>16&255]+$i[t>>24&255]+$i[i&255]+$i[i>>8&255]+$i[i>>16&255]+$i[i>>24&255]).toLowerCase()}function jt(n,e,t){return Math.max(e,Math.min(t,n))}function Y0(n,e){return(n%e+e)%e}function DN(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function IN(n,e,t){return n!==e?(t-n)/(e-n):0}function zh(n,e,t){return(1-t)*n+t*e}function LN(n,e,t,i){return zh(n,e,1-Math.exp(-t*i))}function BN(n,e=1){return e-Math.abs(Y0(n,e*2)-e)}function zN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function PN(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function FN(n,e){return n+Math.floor(Math.random()*(e-n+1))}function jN(n,e){return n+Math.random()*(e-n)}function UN(n){return n*(.5-Math.random())}function HN(n){n!==void 0&&(HS=n);let e=HS+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function qN(n){return n*Cl}function VN(n){return n*Yh}function WN(n){return(n&n-1)===0&&n!==0}function $N(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function GN(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function KN(n,e,t,i,r){const a=Math.cos,l=Math.sin,o=a(t/2),u=l(t/2),h=a((e+i)/2),p=l((e+i)/2),f=a((e-i)/2),m=l((e-i)/2),g=a((i-e)/2),_=l((i-e)/2);switch(r){case"XYX":n.set(o*p,u*f,u*m,o*h);break;case"YZY":n.set(u*m,o*p,u*f,o*h);break;case"ZXZ":n.set(u*f,u*m,o*p,o*h);break;case"XZX":n.set(o*p,u*_,u*g,o*h);break;case"YXY":n.set(u*g,o*p,u*_,o*h);break;case"ZYZ":n.set(u*_,u*g,o*p,o*h);break;default:zt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function sr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Zt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const DK={DEG2RAD:Cl,RAD2DEG:Yh,generateUUID:Dr,clamp:jt,euclideanModulo:Y0,mapLinear:DN,inverseLerp:IN,lerp:zh,damp:LN,pingpong:BN,smoothstep:zN,smootherstep:PN,randInt:FN,randFloat:jN,randFloatSpread:UN,seededRandom:HN,degToRad:qN,radToDeg:VN,isPowerOfTwo:WN,ceilPowerOfTwo:$N,floorPowerOfTwo:GN,setQuaternionFromProperEuler:KN,normalize:Zt,denormalize:sr};class Qe{constructor(e=0,t=0){Qe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=jt(this.x,e.x,t.x),this.y=jt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=jt(this.x,e,t),this.y=jt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(jt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(jt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),a=this.x-e.x,l=this.y-e.y;return this.x=a*i-l*r+e.x,this.y=a*r+l*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ir{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,a,l,o){let u=i[r+0],h=i[r+1],p=i[r+2],f=i[r+3],m=a[l+0],g=a[l+1],_=a[l+2],w=a[l+3];if(o<=0){e[t+0]=u,e[t+1]=h,e[t+2]=p,e[t+3]=f;return}if(o>=1){e[t+0]=m,e[t+1]=g,e[t+2]=_,e[t+3]=w;return}if(f!==w||u!==m||h!==g||p!==_){let v=u*m+h*g+p*_+f*w;v<0&&(m=-m,g=-g,_=-_,w=-w,v=-v);let x=1-o;if(v<.9995){const S=Math.acos(v),b=Math.sin(S);x=Math.sin(x*S)/b,o=Math.sin(o*S)/b,u=u*x+m*o,h=h*x+g*o,p=p*x+_*o,f=f*x+w*o}else{u=u*x+m*o,h=h*x+g*o,p=p*x+_*o,f=f*x+w*o;const S=1/Math.sqrt(u*u+h*h+p*p+f*f);u*=S,h*=S,p*=S,f*=S}}e[t]=u,e[t+1]=h,e[t+2]=p,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,a,l){const o=i[r],u=i[r+1],h=i[r+2],p=i[r+3],f=a[l],m=a[l+1],g=a[l+2],_=a[l+3];return e[t]=o*_+p*f+u*g-h*m,e[t+1]=u*_+p*m+h*f-o*g,e[t+2]=h*_+p*g+o*m-u*f,e[t+3]=p*_-o*f-u*m-h*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,a=e._z,l=e._order,o=Math.cos,u=Math.sin,h=o(i/2),p=o(r/2),f=o(a/2),m=u(i/2),g=u(r/2),_=u(a/2);switch(l){case"XYZ":this._x=m*p*f+h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f-m*g*_;break;case"YXZ":this._x=m*p*f+h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f+m*g*_;break;case"ZXY":this._x=m*p*f-h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f-m*g*_;break;case"ZYX":this._x=m*p*f-h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f+m*g*_;break;case"YZX":this._x=m*p*f+h*g*_,this._y=h*g*f+m*p*_,this._z=h*p*_-m*g*f,this._w=h*p*f-m*g*_;break;case"XZY":this._x=m*p*f-h*g*_,this._y=h*g*f-m*p*_,this._z=h*p*_+m*g*f,this._w=h*p*f+m*g*_;break;default:zt("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],a=t[8],l=t[1],o=t[5],u=t[9],h=t[2],p=t[6],f=t[10],m=i+o+f;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(p-u)*g,this._y=(a-h)*g,this._z=(l-r)*g}else if(i>o&&i>f){const g=2*Math.sqrt(1+i-o-f);this._w=(p-u)/g,this._x=.25*g,this._y=(r+l)/g,this._z=(a+h)/g}else if(o>f){const g=2*Math.sqrt(1+o-i-f);this._w=(a-h)/g,this._x=(r+l)/g,this._y=.25*g,this._z=(u+p)/g}else{const g=2*Math.sqrt(1+f-i-o);this._w=(l-r)/g,this._x=(a+h)/g,this._y=(u+p)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(jt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,a=e._z,l=e._w,o=t._x,u=t._y,h=t._z,p=t._w;return this._x=i*p+l*o+r*h-a*u,this._y=r*p+l*u+a*o-i*h,this._z=a*p+l*h+i*u-r*o,this._w=l*p-i*o-r*u-a*h,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let i=e._x,r=e._y,a=e._z,l=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,a=-a,l=-l,o=-o);let u=1-t;if(o<.9995){const h=Math.acos(o),p=Math.sin(h);u=Math.sin(u*h)/p,t=Math.sin(t*h)/p,this._x=this._x*u+i*t,this._y=this._y*u+r*t,this._z=this._z*u+a*t,this._w=this._w*u+l*t,this._onChangeCallback()}else this._x=this._x*u+i*t,this._y=this._y*u+r*t,this._z=this._z*u+a*t,this._w=this._w*u+l*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class se{constructor(e=0,t=0,i=0){se.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(qS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(qS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*r,this.y=a[1]*t+a[4]*i+a[7]*r,this.z=a[2]*t+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,a=e.elements,l=1/(a[3]*t+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*r+a[12])*l,this.y=(a[1]*t+a[5]*i+a[9]*r+a[13])*l,this.z=(a[2]*t+a[6]*i+a[10]*r+a[14])*l,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,a=e.x,l=e.y,o=e.z,u=e.w,h=2*(l*r-o*i),p=2*(o*t-a*r),f=2*(a*i-l*t);return this.x=t+u*h+l*f-o*p,this.y=i+u*p+o*h-a*f,this.z=r+u*f+a*p-l*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r,this.y=a[1]*t+a[5]*i+a[9]*r,this.z=a[2]*t+a[6]*i+a[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=jt(this.x,e.x,t.x),this.y=jt(this.y,e.y,t.y),this.z=jt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=jt(this.x,e,t),this.y=jt(this.y,e,t),this.z=jt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(jt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,a=e.z,l=t.x,o=t.y,u=t.z;return this.x=r*u-a*o,this.y=a*l-i*u,this.z=i*o-r*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Iy.copy(this).projectOnVector(e),this.sub(Iy)}reflect(e){return this.sub(Iy.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(jt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Iy=new se,qS=new Ir;class ea{constructor(e,t,i,r,a,l,o,u,h){ea.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,a,l,o,u,h)}set(e,t,i,r,a,l,o,u,h){const p=this.elements;return p[0]=e,p[1]=r,p[2]=o,p[3]=t,p[4]=a,p[5]=u,p[6]=i,p[7]=l,p[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,a=this.elements,l=i[0],o=i[3],u=i[6],h=i[1],p=i[4],f=i[7],m=i[2],g=i[5],_=i[8],w=r[0],v=r[3],x=r[6],S=r[1],b=r[4],C=r[7],O=r[2],M=r[5],D=r[8];return a[0]=l*w+o*S+u*O,a[3]=l*v+o*b+u*M,a[6]=l*x+o*C+u*D,a[1]=h*w+p*S+f*O,a[4]=h*v+p*b+f*M,a[7]=h*x+p*C+f*D,a[2]=m*w+g*S+_*O,a[5]=m*v+g*b+_*M,a[8]=m*x+g*C+_*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8];return t*l*p-t*o*h-i*a*p+i*o*u+r*a*h-r*l*u}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8],f=p*l-o*h,m=o*u-p*a,g=h*a-l*u,_=t*f+i*m+r*g;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=f*w,e[1]=(r*h-p*i)*w,e[2]=(o*i-r*l)*w,e[3]=m*w,e[4]=(p*t-r*u)*w,e[5]=(r*a-o*t)*w,e[6]=g*w,e[7]=(i*u-h*t)*w,e[8]=(l*t-i*a)*w,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,a,l,o){const u=Math.cos(a),h=Math.sin(a);return this.set(i*u,i*h,-i*(u*l+h*o)+l+e,-r*h,r*u,-r*(-h*l+u*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ly.makeScale(e,t)),this}rotate(e){return this.premultiply(Ly.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ly.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ly=new ea,VS=new ea().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),WS=new ea().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function YN(){const n={enabled:!0,workingColorSpace:BS,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Dy&&(r.r=Pa(r.r),r.g=Pa(r.g),r.b=Pa(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Dy&&(r.r=eu(r.r),r.g=eu(r.g),r.b=eu(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===ZE?zS:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return US("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return US("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[BS]:{primaries:e,whitePoint:i,transfer:zS,toXYZ:VS,fromXYZ:WS,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Jr},outputColorSpaceConfig:{drawingBufferColorSpace:Jr}},[Jr]:{primaries:e,whitePoint:i,transfer:Dy,toXYZ:VS,fromXYZ:WS,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Jr}}}),n}const Rr=YN();function Pa(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function eu(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Cc;class XN{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Cc===void 0&&(Cc=Up("canvas")),Cc.width=e.width,Cc.height=e.height;const r=Cc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Cc}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Up("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=Pa(a[l]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Pa(t[i]/255)*255):t[i]=Pa(t[i]);return{data:t,width:e.width,height:e.height}}else return zt("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let ZN=0;class Sl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ZN++}),this.uuid=Dr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let l=0,o=r.length;l<o;l++)r[l].isDataTexture?a.push(By(r[l].image)):a.push(By(r[l]))}else a=By(r);i.url=a}return t||(e.images[this.uuid]=i),i}}function By(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?XN.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(zt("Texture: Unable to serialize Texture."),{})}let JN=0;const zy=new se;class vi extends Po{constructor(e=vi.DEFAULT_IMAGE,t=vi.DEFAULT_MAPPING,i=Ks,r=Ks,a=ts,l=pm,o=Gh,u=G0,h=vi.DEFAULT_ANISOTROPY,p=ZE){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:JN++}),this.uuid=Dr(),this.name="",this.source=new Sl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=u,this.offset=new Qe(0,0),this.repeat=new Qe(1,1),this.center=new Qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ea,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(zy).x}get height(){return this.source.getSize(zy).y}get depth(){return this.source.getSize(zy).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){zt(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){zt(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case s0:e.x=e.x-Math.floor(e.x);break;case Ks:e.x=e.x<0?0:1;break;case a0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case s0:e.y=e.y-Math.floor(e.y);break;case Ks:e.y=e.y<0?0:1;break;case a0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}vi.DEFAULT_IMAGE=null;vi.DEFAULT_MAPPING=$0;vi.DEFAULT_ANISOTROPY=1;class is{constructor(e=0,t=0,i=0,r=1){is.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,a=this.w,l=e.elements;return this.x=l[0]*t+l[4]*i+l[8]*r+l[12]*a,this.y=l[1]*t+l[5]*i+l[9]*r+l[13]*a,this.z=l[2]*t+l[6]*i+l[10]*r+l[14]*a,this.w=l[3]*t+l[7]*i+l[11]*r+l[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,a;const u=e.elements,h=u[0],p=u[4],f=u[8],m=u[1],g=u[5],_=u[9],w=u[2],v=u[6],x=u[10];if(Math.abs(p-m)<.01&&Math.abs(f-w)<.01&&Math.abs(_-v)<.01){if(Math.abs(p+m)<.1&&Math.abs(f+w)<.1&&Math.abs(_+v)<.1&&Math.abs(h+g+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(h+1)/2,C=(g+1)/2,O=(x+1)/2,M=(p+m)/4,D=(f+w)/4,N=(_+v)/4;return b>C&&b>O?b<.01?(i=0,r=.707106781,a=.707106781):(i=Math.sqrt(b),r=M/i,a=D/i):C>O?C<.01?(i=.707106781,r=0,a=.707106781):(r=Math.sqrt(C),i=M/r,a=N/r):O<.01?(i=.707106781,r=.707106781,a=0):(a=Math.sqrt(O),i=D/a,r=N/a),this.set(i,r,a,t),this}let S=Math.sqrt((v-_)*(v-_)+(f-w)*(f-w)+(m-p)*(m-p));return Math.abs(S)<.001&&(S=1),this.x=(v-_)/S,this.y=(f-w)/S,this.z=(m-p)/S,this.w=Math.acos((h+g+x-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=jt(this.x,e.x,t.x),this.y=jt(this.y,e.y,t.y),this.z=jt(this.z,e.z,t.z),this.w=jt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=jt(this.x,e,t),this.y=jt(this.y,e,t),this.z=jt(this.z,e,t),this.w=jt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(jt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class QE extends Po{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ts,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new is(0,0,e,t),this.scissorTest=!1,this.viewport=new is(0,0,e,t);const r={width:e,height:t,depth:i.depth},a=new vi(r);this.textures=[];const l=i.count;for(let o=0;o<l;o++)this.textures[o]=a.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:ts,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new Sl(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class X0 extends QE{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class QN extends vi{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Br,this.minFilter=Br,this.wrapR=Ks,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class IK extends X0{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new QN(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class e2 extends vi{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Br,this.minFilter=Br,this.wrapR=Ks,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class LK extends X0{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new e2(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class or{constructor(e=new se(1/0,1/0,1/0),t=new se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(fs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(fs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=fs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const a=i.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let l=0,o=a.count;l<o;l++)e.isMesh===!0?e.getVertexPosition(l,fs):fs.fromBufferAttribute(a,l),fs.applyMatrix4(e.matrixWorld),this.expandByPoint(fs);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Af.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Af.copy(i.boundingBox)),Af.applyMatrix4(e.matrixWorld),this.union(Af)}const r=e.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fs),fs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fh),Tf.subVectors(this.max,fh),Ec.subVectors(e.a,fh),kc.subVectors(e.b,fh),Ac.subVectors(e.c,fh),Eo.subVectors(kc,Ec),ko.subVectors(Ac,kc),ll.subVectors(Ec,Ac);let t=[0,-Eo.z,Eo.y,0,-ko.z,ko.y,0,-ll.z,ll.y,Eo.z,0,-Eo.x,ko.z,0,-ko.x,ll.z,0,-ll.x,-Eo.y,Eo.x,0,-ko.y,ko.x,0,-ll.y,ll.x,0];return!Py(t,Ec,kc,Ac,Tf)||(t=[1,0,0,0,1,0,0,0,1],!Py(t,Ec,kc,Ac,Tf))?!1:(Mf.crossVectors(Eo,ko),t=[Mf.x,Mf.y,Mf.z],Py(t,Ec,kc,Ac,Tf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fs).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ta[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ta[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ta[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ta[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ta[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ta[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ta[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ta[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ta),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ta=[new se,new se,new se,new se,new se,new se,new se,new se],fs=new se,Af=new or,Ec=new se,kc=new se,Ac=new se,Eo=new se,ko=new se,ll=new se,fh=new se,Tf=new se,Mf=new se,cl=new se;function Py(n,e,t,i,r){for(let a=0,l=n.length-3;a<=l;a+=3){cl.fromArray(n,a);const o=r.x*Math.abs(cl.x)+r.y*Math.abs(cl.y)+r.z*Math.abs(cl.z),u=e.dot(cl),h=t.dot(cl),p=i.dot(cl);if(Math.max(-Math.max(u,h,p),Math.min(u,h,p))>o)return!1}return!0}const eD=new or,ph=new se,Fy=new se;class Xi{constructor(e=new se,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):eD.setFromPoints(e).getCenter(i);let r=0;for(let a=0,l=e.length;a<l;a++)r=Math.max(r,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ph.subVectors(e,this.center);const t=ph.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(ph,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Fy.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ph.copy(e.center).add(Fy)),this.expandByPoint(ph.copy(e.center).sub(Fy))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Ma=new se,jy=new se,Rf=new se,Ao=new se,Uy=new se,Of=new se,Hy=new se;class ad{constructor(e=new se,t=new se(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ma)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ma.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ma.copy(this.origin).addScaledVector(this.direction,t),Ma.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){jy.copy(e).add(t).multiplyScalar(.5),Rf.copy(t).sub(e).normalize(),Ao.copy(this.origin).sub(jy);const a=e.distanceTo(t)*.5,l=-this.direction.dot(Rf),o=Ao.dot(this.direction),u=-Ao.dot(Rf),h=Ao.lengthSq(),p=Math.abs(1-l*l);let f,m,g,_;if(p>0)if(f=l*u-o,m=l*o-u,_=a*p,f>=0)if(m>=-_)if(m<=_){const w=1/p;f*=w,m*=w,g=f*(f+l*m+2*o)+m*(l*f+m+2*u)+h}else m=a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;else m=-a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;else m<=-_?(f=Math.max(0,-(-l*a+o)),m=f>0?-a:Math.min(Math.max(-a,-u),a),g=-f*f+m*(m+2*u)+h):m<=_?(f=0,m=Math.min(Math.max(-a,-u),a),g=m*(m+2*u)+h):(f=Math.max(0,-(l*a+o)),m=f>0?a:Math.min(Math.max(-a,-u),a),g=-f*f+m*(m+2*u)+h);else m=l>0?-a:a,f=Math.max(0,-(l*m+o)),g=-f*f+m*(m+2*u)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(jy).addScaledVector(Rf,m),g}intersectSphere(e,t){Ma.subVectors(e.center,this.origin);const i=Ma.dot(this.direction),r=Ma.dot(Ma)-i*i,a=e.radius*e.radius;if(r>a)return null;const l=Math.sqrt(a-r),o=i-l,u=i+l;return u<0?null:o<0?this.at(u,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,a,l,o,u;const h=1/this.direction.x,p=1/this.direction.y,f=1/this.direction.z,m=this.origin;return h>=0?(i=(e.min.x-m.x)*h,r=(e.max.x-m.x)*h):(i=(e.max.x-m.x)*h,r=(e.min.x-m.x)*h),p>=0?(a=(e.min.y-m.y)*p,l=(e.max.y-m.y)*p):(a=(e.max.y-m.y)*p,l=(e.min.y-m.y)*p),i>l||a>r||((a>i||isNaN(i))&&(i=a),(l<r||isNaN(r))&&(r=l),f>=0?(o=(e.min.z-m.z)*f,u=(e.max.z-m.z)*f):(o=(e.max.z-m.z)*f,u=(e.min.z-m.z)*f),i>u||o>r)||((o>i||i!==i)&&(i=o),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ma)!==null}intersectTriangle(e,t,i,r,a){Uy.subVectors(t,e),Of.subVectors(i,e),Hy.crossVectors(Uy,Of);let l=this.direction.dot(Hy),o;if(l>0){if(r)return null;o=1}else if(l<0)o=-1,l=-l;else return null;Ao.subVectors(this.origin,e);const u=o*this.direction.dot(Of.crossVectors(Ao,Of));if(u<0)return null;const h=o*this.direction.dot(Uy.cross(Ao));if(h<0||u+h>l)return null;const p=-o*Ao.dot(Hy);return p<0?null:this.at(p/l,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tn{constructor(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v){tn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v)}set(e,t,i,r,a,l,o,u,h,p,f,m,g,_,w,v){const x=this.elements;return x[0]=e,x[4]=t,x[8]=i,x[12]=r,x[1]=a,x[5]=l,x[9]=o,x[13]=u,x[2]=h,x[6]=p,x[10]=f,x[14]=m,x[3]=g,x[7]=_,x[11]=w,x[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new tn().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/Tc.setFromMatrixColumn(e,0).length(),a=1/Tc.setFromMatrixColumn(e,1).length(),l=1/Tc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*l,t[9]=i[9]*l,t[10]=i[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,a=e.z,l=Math.cos(i),o=Math.sin(i),u=Math.cos(r),h=Math.sin(r),p=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){const m=l*p,g=l*f,_=o*p,w=o*f;t[0]=u*p,t[4]=-u*f,t[8]=h,t[1]=g+_*h,t[5]=m-w*h,t[9]=-o*u,t[2]=w-m*h,t[6]=_+g*h,t[10]=l*u}else if(e.order==="YXZ"){const m=u*p,g=u*f,_=h*p,w=h*f;t[0]=m+w*o,t[4]=_*o-g,t[8]=l*h,t[1]=l*f,t[5]=l*p,t[9]=-o,t[2]=g*o-_,t[6]=w+m*o,t[10]=l*u}else if(e.order==="ZXY"){const m=u*p,g=u*f,_=h*p,w=h*f;t[0]=m-w*o,t[4]=-l*f,t[8]=_+g*o,t[1]=g+_*o,t[5]=l*p,t[9]=w-m*o,t[2]=-l*h,t[6]=o,t[10]=l*u}else if(e.order==="ZYX"){const m=l*p,g=l*f,_=o*p,w=o*f;t[0]=u*p,t[4]=_*h-g,t[8]=m*h+w,t[1]=u*f,t[5]=w*h+m,t[9]=g*h-_,t[2]=-h,t[6]=o*u,t[10]=l*u}else if(e.order==="YZX"){const m=l*u,g=l*h,_=o*u,w=o*h;t[0]=u*p,t[4]=w-m*f,t[8]=_*f+g,t[1]=f,t[5]=l*p,t[9]=-o*p,t[2]=-h*p,t[6]=g*f+_,t[10]=m-w*f}else if(e.order==="XZY"){const m=l*u,g=l*h,_=o*u,w=o*h;t[0]=u*p,t[4]=-f,t[8]=h*p,t[1]=m*f+w,t[5]=l*p,t[9]=g*f-_,t[2]=_*f-g,t[6]=o*p,t[10]=w*f+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(tD,e,nD)}lookAt(e,t,i){const r=this.elements;return Ar.subVectors(e,t),Ar.lengthSq()===0&&(Ar.z=1),Ar.normalize(),To.crossVectors(i,Ar),To.lengthSq()===0&&(Math.abs(i.z)===1?Ar.x+=1e-4:Ar.z+=1e-4,Ar.normalize(),To.crossVectors(i,Ar)),To.normalize(),Nf.crossVectors(Ar,To),r[0]=To.x,r[4]=Nf.x,r[8]=Ar.x,r[1]=To.y,r[5]=Nf.y,r[9]=Ar.y,r[2]=To.z,r[6]=Nf.z,r[10]=Ar.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,a=this.elements,l=i[0],o=i[4],u=i[8],h=i[12],p=i[1],f=i[5],m=i[9],g=i[13],_=i[2],w=i[6],v=i[10],x=i[14],S=i[3],b=i[7],C=i[11],O=i[15],M=r[0],D=r[4],N=r[8],B=r[12],U=r[1],Y=r[5],K=r[9],H=r[13],J=r[2],Q=r[6],Z=r[10],ie=r[14],ne=r[3],P=r[7],L=r[11],F=r[15];return a[0]=l*M+o*U+u*J+h*ne,a[4]=l*D+o*Y+u*Q+h*P,a[8]=l*N+o*K+u*Z+h*L,a[12]=l*B+o*H+u*ie+h*F,a[1]=p*M+f*U+m*J+g*ne,a[5]=p*D+f*Y+m*Q+g*P,a[9]=p*N+f*K+m*Z+g*L,a[13]=p*B+f*H+m*ie+g*F,a[2]=_*M+w*U+v*J+x*ne,a[6]=_*D+w*Y+v*Q+x*P,a[10]=_*N+w*K+v*Z+x*L,a[14]=_*B+w*H+v*ie+x*F,a[3]=S*M+b*U+C*J+O*ne,a[7]=S*D+b*Y+C*Q+O*P,a[11]=S*N+b*K+C*Z+O*L,a[15]=S*B+b*H+C*ie+O*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],a=e[12],l=e[1],o=e[5],u=e[9],h=e[13],p=e[2],f=e[6],m=e[10],g=e[14],_=e[3],w=e[7],v=e[11],x=e[15],S=u*g-h*m,b=o*g-h*f,C=o*m-u*f,O=l*g-h*p,M=l*m-u*p,D=l*f-o*p;return t*(w*S-v*b+x*C)-i*(_*S-v*O+x*M)+r*(_*b-w*O+x*D)-a*(_*C-w*M+v*D)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],l=e[4],o=e[5],u=e[6],h=e[7],p=e[8],f=e[9],m=e[10],g=e[11],_=e[12],w=e[13],v=e[14],x=e[15],S=f*v*h-w*m*h+w*u*g-o*v*g-f*u*x+o*m*x,b=_*m*h-p*v*h-_*u*g+l*v*g+p*u*x-l*m*x,C=p*w*h-_*f*h+_*o*g-l*w*g-p*o*x+l*f*x,O=_*f*u-p*w*u-_*o*m+l*w*m+p*o*v-l*f*v,M=t*S+i*b+r*C+a*O;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/M;return e[0]=S*D,e[1]=(w*m*a-f*v*a-w*r*g+i*v*g+f*r*x-i*m*x)*D,e[2]=(o*v*a-w*u*a+w*r*h-i*v*h-o*r*x+i*u*x)*D,e[3]=(f*u*a-o*m*a-f*r*h+i*m*h+o*r*g-i*u*g)*D,e[4]=b*D,e[5]=(p*v*a-_*m*a+_*r*g-t*v*g-p*r*x+t*m*x)*D,e[6]=(_*u*a-l*v*a-_*r*h+t*v*h+l*r*x-t*u*x)*D,e[7]=(l*m*a-p*u*a+p*r*h-t*m*h-l*r*g+t*u*g)*D,e[8]=C*D,e[9]=(_*f*a-p*w*a-_*i*g+t*w*g+p*i*x-t*f*x)*D,e[10]=(l*w*a-_*o*a+_*i*h-t*w*h-l*i*x+t*o*x)*D,e[11]=(p*o*a-l*f*a-p*i*h+t*f*h+l*i*g-t*o*g)*D,e[12]=O*D,e[13]=(p*w*r-_*f*r+_*i*m-t*w*m-p*i*v+t*f*v)*D,e[14]=(_*o*r-l*w*r-_*i*u+t*w*u+l*i*v-t*o*v)*D,e[15]=(l*f*r-p*o*r+p*i*u-t*f*u-l*i*m+t*o*m)*D,this}scale(e){const t=this.elements,i=e.x,r=e.y,a=e.z;return t[0]*=i,t[4]*=r,t[8]*=a,t[1]*=i,t[5]*=r,t[9]*=a,t[2]*=i,t[6]*=r,t[10]*=a,t[3]*=i,t[7]*=r,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),a=1-i,l=e.x,o=e.y,u=e.z,h=a*l,p=a*o;return this.set(h*l+i,h*o-r*u,h*u+r*o,0,h*o+r*u,p*o+i,p*u-r*l,0,h*u-r*o,p*u+r*l,a*u*u+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,a,l){return this.set(1,i,a,0,e,1,l,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,a=t._x,l=t._y,o=t._z,u=t._w,h=a+a,p=l+l,f=o+o,m=a*h,g=a*p,_=a*f,w=l*p,v=l*f,x=o*f,S=u*h,b=u*p,C=u*f,O=i.x,M=i.y,D=i.z;return r[0]=(1-(w+x))*O,r[1]=(g+C)*O,r[2]=(_-b)*O,r[3]=0,r[4]=(g-C)*M,r[5]=(1-(m+x))*M,r[6]=(v+S)*M,r[7]=0,r[8]=(_+b)*D,r[9]=(v-S)*D,r[10]=(1-(m+w))*D,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),t.identity(),this;let a=Tc.set(r[0],r[1],r[2]).length();const l=Tc.set(r[4],r[5],r[6]).length(),o=Tc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),ps.copy(this);const h=1/a,p=1/l,f=1/o;return ps.elements[0]*=h,ps.elements[1]*=h,ps.elements[2]*=h,ps.elements[4]*=p,ps.elements[5]*=p,ps.elements[6]*=p,ps.elements[8]*=f,ps.elements[9]*=f,ps.elements[10]*=f,t.setFromRotationMatrix(ps),i.x=a,i.y=l,i.z=o,this}makePerspective(e,t,i,r,a,l,o=Ys,u=!1){const h=this.elements,p=2*a/(t-e),f=2*a/(i-r),m=(t+e)/(t-e),g=(i+r)/(i-r);let _,w;if(u)_=a/(l-a),w=l*a/(l-a);else if(o===Ys)_=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(o===Kh)_=-l/(l-a),w=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=p,h[4]=0,h[8]=m,h[12]=0,h[1]=0,h[5]=f,h[9]=g,h[13]=0,h[2]=0,h[6]=0,h[10]=_,h[14]=w,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,r,a,l,o=Ys,u=!1){const h=this.elements,p=2/(t-e),f=2/(i-r),m=-(t+e)/(t-e),g=-(i+r)/(i-r);let _,w;if(u)_=1/(l-a),w=l/(l-a);else if(o===Ys)_=-2/(l-a),w=-(l+a)/(l-a);else if(o===Kh)_=-1/(l-a),w=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=p,h[4]=0,h[8]=0,h[12]=m,h[1]=0,h[5]=f,h[9]=0,h[13]=g,h[2]=0,h[6]=0,h[10]=_,h[14]=w,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Tc=new se,ps=new tn,tD=new se(0,0,0),nD=new se(1,1,1),To=new se,Nf=new se,Ar=new se,$S=new tn,GS=new Ir;class Js{constructor(e=0,t=0,i=0,r=Js.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,a=r[0],l=r[4],o=r[8],u=r[1],h=r[5],p=r[9],f=r[2],m=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(jt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-p,g),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-jt(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-f,a),this._z=0);break;case"ZXY":this._x=Math.asin(jt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-f,g),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-jt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(jt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,h),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-jt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-p,g),this._y=0);break;default:zt("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return $S.makeRotationFromQuaternion(e),this.setFromRotationMatrix($S,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return GS.setFromEuler(this),this.setFromQuaternion(GS,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Js.DEFAULT_ORDER="XYZ";class t2{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let iD=0;const KS=new se,Mc=new Ir,Ra=new tn,Df=new se,mh=new se,rD=new se,sD=new Ir,YS=new se(1,0,0),XS=new se(0,1,0),ZS=new se(0,0,1),JS={type:"added"},aD={type:"removed"},Rc={type:"childadded",child:null},qy={type:"childremoved",child:null};class Cn extends Po{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:iD++}),this.uuid=Dr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Cn.DEFAULT_UP.clone();const e=new se,t=new Js,i=new Ir,r=new se(1,1,1);function a(){i.setFromEuler(t,!1)}function l(){t.setFromQuaternion(i,void 0,!1)}t._onChange(a),i._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new tn},normalMatrix:{value:new ea}}),this.matrix=new tn,this.matrixWorld=new tn,this.matrixAutoUpdate=Cn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Cn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new t2,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mc.setFromAxisAngle(e,t),this.quaternion.multiply(Mc),this}rotateOnWorldAxis(e,t){return Mc.setFromAxisAngle(e,t),this.quaternion.premultiply(Mc),this}rotateX(e){return this.rotateOnAxis(YS,e)}rotateY(e){return this.rotateOnAxis(XS,e)}rotateZ(e){return this.rotateOnAxis(ZS,e)}translateOnAxis(e,t){return KS.copy(e).applyQuaternion(this.quaternion),this.position.add(KS.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(YS,e)}translateY(e){return this.translateOnAxis(XS,e)}translateZ(e){return this.translateOnAxis(ZS,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ra.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Df.copy(e):Df.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),mh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ra.lookAt(mh,Df,this.up):Ra.lookAt(Df,mh,this.up),this.quaternion.setFromRotationMatrix(Ra),r&&(Ra.extractRotation(r.matrixWorld),Mc.setFromRotationMatrix(Ra),this.quaternion.premultiply(Mc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(wn("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(JS),Rc.child=e,this.dispatchEvent(Rc),Rc.child=null):wn("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(aD),qy.child=e,this.dispatchEvent(qy),qy.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ra.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ra.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ra),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(JS),Rc.child=e,this.dispatchEvent(Rc),Rc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const l=this.children[i].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,e,rD),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,sD,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(o,u){return o[u.uuid]===void 0&&(o[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const u=o.shapes;if(Array.isArray(u))for(let h=0,p=u.length;h<p;h++){const f=u[h];a(e.shapes,f)}else a(e.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let u=0,h=this.material.length;u<h;u++)o.push(a(e.materials,this.material[u]));r.material=o}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const u=this.animations[o];r.animations.push(a(e.animations,u))}}if(t){const o=l(e.geometries),u=l(e.materials),h=l(e.textures),p=l(e.images),f=l(e.shapes),m=l(e.skeletons),g=l(e.animations),_=l(e.nodes);o.length>0&&(i.geometries=o),u.length>0&&(i.materials=u),h.length>0&&(i.textures=h),p.length>0&&(i.images=p),f.length>0&&(i.shapes=f),m.length>0&&(i.skeletons=m),g.length>0&&(i.animations=g),_.length>0&&(i.nodes=_)}return i.object=r,i;function l(o){const u=[];for(const h in o){const p=o[h];delete p.metadata,u.push(p)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Cn.DEFAULT_UP=new se(0,1,0);Cn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Cn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ms=new se,Oa=new se,Vy=new se,Na=new se,Oc=new se,Nc=new se,QS=new se,Wy=new se,$y=new se,Gy=new se,Ky=new is,Yy=new is,Xy=new is;class Or{constructor(e=new se,t=new se,i=new se){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),ms.subVectors(e,t),r.cross(ms);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,t,i,r,a){ms.subVectors(r,t),Oa.subVectors(i,t),Vy.subVectors(e,t);const l=ms.dot(ms),o=ms.dot(Oa),u=ms.dot(Vy),h=Oa.dot(Oa),p=Oa.dot(Vy),f=l*h-o*o;if(f===0)return a.set(0,0,0),null;const m=1/f,g=(h*u-o*p)*m,_=(l*p-o*u)*m;return a.set(1-g-_,_,g)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Na)===null?!1:Na.x>=0&&Na.y>=0&&Na.x+Na.y<=1}static getInterpolation(e,t,i,r,a,l,o,u){return this.getBarycoord(e,t,i,r,Na)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,Na.x),u.addScaledVector(l,Na.y),u.addScaledVector(o,Na.z),u)}static getInterpolatedAttribute(e,t,i,r,a,l){return Ky.setScalar(0),Yy.setScalar(0),Xy.setScalar(0),Ky.fromBufferAttribute(e,t),Yy.fromBufferAttribute(e,i),Xy.fromBufferAttribute(e,r),l.setScalar(0),l.addScaledVector(Ky,a.x),l.addScaledVector(Yy,a.y),l.addScaledVector(Xy,a.z),l}static isFrontFacing(e,t,i,r){return ms.subVectors(i,t),Oa.subVectors(e,t),ms.cross(Oa).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ms.subVectors(this.c,this.b),Oa.subVectors(this.a,this.b),ms.cross(Oa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Or.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Or.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,a){return Or.getInterpolation(e,this.a,this.b,this.c,t,i,r,a)}containsPoint(e){return Or.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Or.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,a=this.c;let l,o;Oc.subVectors(r,i),Nc.subVectors(a,i),Wy.subVectors(e,i);const u=Oc.dot(Wy),h=Nc.dot(Wy);if(u<=0&&h<=0)return t.copy(i);$y.subVectors(e,r);const p=Oc.dot($y),f=Nc.dot($y);if(p>=0&&f<=p)return t.copy(r);const m=u*f-p*h;if(m<=0&&u>=0&&p<=0)return l=u/(u-p),t.copy(i).addScaledVector(Oc,l);Gy.subVectors(e,a);const g=Oc.dot(Gy),_=Nc.dot(Gy);if(_>=0&&g<=_)return t.copy(a);const w=g*h-u*_;if(w<=0&&h>=0&&_<=0)return o=h/(h-_),t.copy(i).addScaledVector(Nc,o);const v=p*_-g*f;if(v<=0&&f-p>=0&&g-_>=0)return QS.subVectors(a,r),o=(f-p)/(f-p+(g-_)),t.copy(r).addScaledVector(QS,o);const x=1/(v+w+m);return l=w*x,o=m*x,t.copy(i).addScaledVector(Oc,l).addScaledVector(Nc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const n2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Mo={h:0,s:0,l:0},If={h:0,s:0,l:0};function Zy(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Vt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Jr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rr.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Rr.workingColorSpace){return this.r=e,this.g=t,this.b=i,Rr.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Rr.workingColorSpace){if(e=Y0(e,1),t=jt(t,0,1),i=jt(i,0,1),t===0)this.r=this.g=this.b=i;else{const a=i<=.5?i*(1+t):i+t-i*t,l=2*i-a;this.r=Zy(l,a,e+1/3),this.g=Zy(l,a,e),this.b=Zy(l,a,e-1/3)}return Rr.colorSpaceToWorking(this,r),this}setStyle(e,t=Jr){function i(a){a!==void 0&&parseFloat(a)<1&&zt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const l=r[1],o=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:zt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(a,16),t);zt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Jr){const i=n2[e.toLowerCase()];return i!==void 0?this.setHex(i,t):zt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Pa(e.r),this.g=Pa(e.g),this.b=Pa(e.b),this}copyLinearToSRGB(e){return this.r=eu(e.r),this.g=eu(e.g),this.b=eu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Jr){return Rr.workingToColorSpace(Gi.copy(this),e),Math.round(jt(Gi.r*255,0,255))*65536+Math.round(jt(Gi.g*255,0,255))*256+Math.round(jt(Gi.b*255,0,255))}getHexString(e=Jr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rr.workingColorSpace){Rr.workingToColorSpace(Gi.copy(this),t);const i=Gi.r,r=Gi.g,a=Gi.b,l=Math.max(i,r,a),o=Math.min(i,r,a);let u,h;const p=(o+l)/2;if(o===l)u=0,h=0;else{const f=l-o;switch(h=p<=.5?f/(l+o):f/(2-l-o),l){case i:u=(r-a)/f+(r<a?6:0);break;case r:u=(a-i)/f+2;break;case a:u=(i-r)/f+4;break}u/=6}return e.h=u,e.s=h,e.l=p,e}getRGB(e,t=Rr.workingColorSpace){return Rr.workingToColorSpace(Gi.copy(this),t),e.r=Gi.r,e.g=Gi.g,e.b=Gi.b,e}getStyle(e=Jr){Rr.workingToColorSpace(Gi.copy(this),e);const t=Gi.r,i=Gi.g,r=Gi.b;return e!==Jr?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Mo),this.setHSL(Mo.h+e,Mo.s+t,Mo.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Mo),e.getHSL(If);const i=zh(Mo.h,If.h,t),r=zh(Mo.s,If.s,t),a=zh(Mo.l,If.l,t);return this.setHSL(i,r,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*r,this.g=a[1]*t+a[4]*i+a[7]*r,this.b=a[2]*t+a[5]*i+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Gi=new Vt;Vt.NAMES=n2;let oD=0;class lr extends Po{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:oD++}),this.uuid=Dr(),this.name="",this.type="Material",this.blending=RS,this.side=r0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=NS,this.blendDst=DS,this.blendEquation=OS,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Vt(0,0,0),this.blendAlpha=0,this.depthFunc=IS,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=PS,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=wc,this.stencilZFail=wc,this.stencilZPass=wc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){zt(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){zt(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==RS&&(i.blending=this.blending),this.side!==r0&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==NS&&(i.blendSrc=this.blendSrc),this.blendDst!==DS&&(i.blendDst=this.blendDst),this.blendEquation!==OS&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==IS&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==PS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==wc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==wc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==wc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(a){const l=[];for(const o in a){const u=a[o];delete u.metadata,l.push(u)}return l}if(t){const a=r(e.textures),l=r(e.images);a.length>0&&(i.textures=a),l.length>0&&(i.images=l)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let a=0;a!==r;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class du extends lr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Js,this.combine=W0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ba=lD();function lD(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let u=0;u<256;++u){const h=u-127;h<-27?(i[u]=0,i[u|256]=32768,r[u]=24,r[u|256]=24):h<-14?(i[u]=1024>>-h-14,i[u|256]=1024>>-h-14|32768,r[u]=-h-1,r[u|256]=-h-1):h<=15?(i[u]=h+15<<10,i[u|256]=h+15<<10|32768,r[u]=13,r[u|256]=13):h<128?(i[u]=31744,i[u|256]=64512,r[u]=24,r[u|256]=24):(i[u]=31744,i[u|256]=64512,r[u]=13,r[u|256]=13)}const a=new Uint32Array(2048),l=new Uint32Array(64),o=new Uint32Array(64);for(let u=1;u<1024;++u){let h=u<<13,p=0;for(;(h&8388608)===0;)h<<=1,p-=8388608;h&=-8388609,p+=947912704,a[u]=h|p}for(let u=1024;u<2048;++u)a[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)l[u]=u<<23;l[31]=1199570944,l[32]=2147483648;for(let u=33;u<63;++u)l[u]=2147483648+(u-32<<23);l[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(o[u]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:l,offsetTable:o}}function yr(n){Math.abs(n)>65504&&zt("DataUtils.toHalfFloat(): Value out of range."),n=jt(n,-65504,65504),Ba.floatView[0]=n;const e=Ba.uint32View[0],t=e>>23&511;return Ba.baseTable[t]+((e&8388607)>>Ba.shiftTable[t])}function Nh(n){const e=n>>10;return Ba.uint32View[0]=Ba.mantissaTable[Ba.offsetTable[e]+(n&1023)]+Ba.exponentTable[e],Ba.floatView[0]}class BK{static toHalfFloat(e){return yr(e)}static fromHalfFloat(e){return Nh(e)}}const yi=new se,Lf=new Qe;let cD=0;class ii{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:cD++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=jp,this.updateRanges=[],this.gpuType=iu,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Lf.fromBufferAttribute(this,t),Lf.applyMatrix3(e),this.setXY(t,Lf.x,Lf.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyMatrix3(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyMatrix4(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.applyNormalMatrix(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)yi.fromBufferAttribute(this,t),yi.transformDirection(e),this.setXYZ(t,yi.x,yi.y,yi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=sr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Zt(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=sr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=sr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=sr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=sr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array),a=Zt(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==jp&&(e.usage=this.usage),e}}class zK extends ii{constructor(e,t,i){super(new Int8Array(e),t,i)}}class PK extends ii{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class FK extends ii{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class jK extends ii{constructor(e,t,i){super(new Int16Array(e),t,i)}}class uD extends ii{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class UK extends ii{constructor(e,t,i){super(new Int32Array(e),t,i)}}class hD extends ii{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class HK extends ii{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=Nh(this.array[e*this.itemSize]);return this.normalized&&(t=sr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize]=yr(t),this}getY(e){let t=Nh(this.array[e*this.itemSize+1]);return this.normalized&&(t=sr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+1]=yr(t),this}getZ(e){let t=Nh(this.array[e*this.itemSize+2]);return this.normalized&&(t=sr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+2]=yr(t),this}getW(e){let t=Nh(this.array[e*this.itemSize+3]);return this.normalized&&(t=sr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+3]=yr(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this.array[e+2]=yr(r),this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array),a=Zt(a,this.array)),this.array[e+0]=yr(t),this.array[e+1]=yr(i),this.array[e+2]=yr(r),this.array[e+3]=yr(a),this}}class xt extends ii{constructor(e,t,i){super(new Float32Array(e),t,i)}}let dD=0;const Zr=new tn,Jy=new Cn,Dc=new se,Tr=new or,gh=new or,Oi=new se;class an extends Po{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:dD++}),this.uuid=Dr(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(ON(e)?hD:uD)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const a=new ea().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zr.makeRotationFromQuaternion(e),this.applyMatrix4(Zr),this}rotateX(e){return Zr.makeRotationX(e),this.applyMatrix4(Zr),this}rotateY(e){return Zr.makeRotationY(e),this.applyMatrix4(Zr),this}rotateZ(e){return Zr.makeRotationZ(e),this.applyMatrix4(Zr),this}translate(e,t,i){return Zr.makeTranslation(e,t,i),this.applyMatrix4(Zr),this}scale(e,t,i){return Zr.makeScale(e,t,i),this.applyMatrix4(Zr),this}lookAt(e){return Jy.lookAt(e),Jy.updateMatrix(),this.applyMatrix4(Jy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Dc).negate(),this.translate(Dc.x,Dc.y,Dc.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,a=e.length;r<a;r++){const l=e[r];i.push(l.x,l.y,l.z||0)}this.setAttribute("position",new xt(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const a=e[r];t.setXYZ(r,a.x,a.y,a.z||0)}e.length>t.count&&zt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new or);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){wn("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const a=t[i];Tr.setFromBufferAttribute(a),this.morphTargetsRelative?(Oi.addVectors(this.boundingBox.min,Tr.min),this.boundingBox.expandByPoint(Oi),Oi.addVectors(this.boundingBox.max,Tr.max),this.boundingBox.expandByPoint(Oi)):(this.boundingBox.expandByPoint(Tr.min),this.boundingBox.expandByPoint(Tr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&wn('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Xi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){wn("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new se,1/0);return}if(e){const i=this.boundingSphere.center;if(Tr.setFromBufferAttribute(e),t)for(let a=0,l=t.length;a<l;a++){const o=t[a];gh.setFromBufferAttribute(o),this.morphTargetsRelative?(Oi.addVectors(Tr.min,gh.min),Tr.expandByPoint(Oi),Oi.addVectors(Tr.max,gh.max),Tr.expandByPoint(Oi)):(Tr.expandByPoint(gh.min),Tr.expandByPoint(gh.max))}Tr.getCenter(i);let r=0;for(let a=0,l=e.count;a<l;a++)Oi.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Oi));if(t)for(let a=0,l=t.length;a<l;a++){const o=t[a],u=this.morphTargetsRelative;for(let h=0,p=o.count;h<p;h++)Oi.fromBufferAttribute(o,h),u&&(Dc.fromBufferAttribute(e,h),Oi.add(Dc)),r=Math.max(r,i.distanceToSquared(Oi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&wn('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){wn("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ii(new Float32Array(4*i.count),4));const l=this.getAttribute("tangent"),o=[],u=[];for(let N=0;N<i.count;N++)o[N]=new se,u[N]=new se;const h=new se,p=new se,f=new se,m=new Qe,g=new Qe,_=new Qe,w=new se,v=new se;function x(N,B,U){h.fromBufferAttribute(i,N),p.fromBufferAttribute(i,B),f.fromBufferAttribute(i,U),m.fromBufferAttribute(a,N),g.fromBufferAttribute(a,B),_.fromBufferAttribute(a,U),p.sub(h),f.sub(h),g.sub(m),_.sub(m);const Y=1/(g.x*_.y-_.x*g.y);isFinite(Y)&&(w.copy(p).multiplyScalar(_.y).addScaledVector(f,-g.y).multiplyScalar(Y),v.copy(f).multiplyScalar(g.x).addScaledVector(p,-_.x).multiplyScalar(Y),o[N].add(w),o[B].add(w),o[U].add(w),u[N].add(v),u[B].add(v),u[U].add(v))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let N=0,B=S.length;N<B;++N){const U=S[N],Y=U.start,K=U.count;for(let H=Y,J=Y+K;H<J;H+=3)x(e.getX(H+0),e.getX(H+1),e.getX(H+2))}const b=new se,C=new se,O=new se,M=new se;function D(N){O.fromBufferAttribute(r,N),M.copy(O);const B=o[N];b.copy(B),b.sub(O.multiplyScalar(O.dot(B))).normalize(),C.crossVectors(M,B);const Y=C.dot(u[N])<0?-1:1;l.setXYZW(N,b.x,b.y,b.z,Y)}for(let N=0,B=S.length;N<B;++N){const U=S[N],Y=U.start,K=U.count;for(let H=Y,J=Y+K;H<J;H+=3)D(e.getX(H+0)),D(e.getX(H+1)),D(e.getX(H+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new ii(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let m=0,g=i.count;m<g;m++)i.setXYZ(m,0,0,0);const r=new se,a=new se,l=new se,o=new se,u=new se,h=new se,p=new se,f=new se;if(e)for(let m=0,g=e.count;m<g;m+=3){const _=e.getX(m+0),w=e.getX(m+1),v=e.getX(m+2);r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,w),l.fromBufferAttribute(t,v),p.subVectors(l,a),f.subVectors(r,a),p.cross(f),o.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),h.fromBufferAttribute(i,v),o.add(p),u.add(p),h.add(p),i.setXYZ(_,o.x,o.y,o.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(v,h.x,h.y,h.z)}else for(let m=0,g=t.count;m<g;m+=3)r.fromBufferAttribute(t,m+0),a.fromBufferAttribute(t,m+1),l.fromBufferAttribute(t,m+2),p.subVectors(l,a),f.subVectors(r,a),p.cross(f),i.setXYZ(m+0,p.x,p.y,p.z),i.setXYZ(m+1,p.x,p.y,p.z),i.setXYZ(m+2,p.x,p.y,p.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Oi.fromBufferAttribute(e,t),Oi.normalize(),e.setXYZ(t,Oi.x,Oi.y,Oi.z)}toNonIndexed(){function e(o,u){const h=o.array,p=o.itemSize,f=o.normalized,m=new h.constructor(u.length*p);let g=0,_=0;for(let w=0,v=u.length;w<v;w++){o.isInterleavedBufferAttribute?g=u[w]*o.data.stride+o.offset:g=u[w]*p;for(let x=0;x<p;x++)m[_++]=h[g++]}return new ii(m,p,f)}if(this.index===null)return zt("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new an,i=this.index.array,r=this.attributes;for(const o in r){const u=r[o],h=e(u,i);t.setAttribute(o,h)}const a=this.morphAttributes;for(const o in a){const u=[],h=a[o];for(let p=0,f=h.length;p<f;p++){const m=h[p],g=e(m,i);u.push(g)}t.morphAttributes[o]=u}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let o=0,u=l.length;o<u;o++){const h=l[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const h in u)u[h]!==void 0&&(e[h]=u[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const u in i){const h=i[u];e.data.attributes[u]=h.toJSON(e.data)}const r={};let a=!1;for(const u in this.morphAttributes){const h=this.morphAttributes[u],p=[];for(let f=0,m=h.length;f<m;f++){const g=h[f];p.push(g.toJSON(e.data))}p.length>0&&(r[u]=p,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const h in r){const p=r[h];this.setAttribute(h,p.clone(t))}const a=e.morphAttributes;for(const h in a){const p=[],f=a[h];for(let m=0,g=f.length;m<g;m++)p.push(f[m].clone(t));this.morphAttributes[h]=p}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let h=0,p=l.length;h<p;h++){const f=l[h];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ew=new tn,ul=new ad,Bf=new Xi,tw=new se,zf=new se,Pf=new se,Ff=new se,Qy=new se,jf=new se,nw=new se,Uf=new se;class Cs extends Cn{constructor(e=new an,t=new du){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(a&&o){jf.set(0,0,0);for(let u=0,h=a.length;u<h;u++){const p=o[u],f=a[u];p!==0&&(Qy.fromBufferAttribute(f,e),l?jf.addScaledVector(Qy,p):jf.addScaledVector(Qy.sub(t),p))}t.add(jf)}return t}raycast(e,t){const i=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Bf.copy(i.boundingSphere),Bf.applyMatrix4(a),ul.copy(e.ray).recast(e.near),!(Bf.containsPoint(ul.origin)===!1&&(ul.intersectSphere(Bf,tw)===null||ul.origin.distanceToSquared(tw)>(e.far-e.near)**2))&&(ew.copy(a).invert(),ul.copy(e.ray).applyMatrix4(ew),!(i.boundingBox!==null&&ul.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ul)))}_computeIntersections(e,t,i){let r;const a=this.geometry,l=this.material,o=a.index,u=a.attributes.position,h=a.attributes.uv,p=a.attributes.uv1,f=a.attributes.normal,m=a.groups,g=a.drawRange;if(o!==null)if(Array.isArray(l))for(let _=0,w=m.length;_<w;_++){const v=m[_],x=l[v.materialIndex],S=Math.max(v.start,g.start),b=Math.min(o.count,Math.min(v.start+v.count,g.start+g.count));for(let C=S,O=b;C<O;C+=3){const M=o.getX(C),D=o.getX(C+1),N=o.getX(C+2);r=Hf(this,x,e,i,h,p,f,M,D,N),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=v.materialIndex,t.push(r))}}else{const _=Math.max(0,g.start),w=Math.min(o.count,g.start+g.count);for(let v=_,x=w;v<x;v+=3){const S=o.getX(v),b=o.getX(v+1),C=o.getX(v+2);r=Hf(this,l,e,i,h,p,f,S,b,C),r&&(r.faceIndex=Math.floor(v/3),t.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let _=0,w=m.length;_<w;_++){const v=m[_],x=l[v.materialIndex],S=Math.max(v.start,g.start),b=Math.min(u.count,Math.min(v.start+v.count,g.start+g.count));for(let C=S,O=b;C<O;C+=3){const M=C,D=C+1,N=C+2;r=Hf(this,x,e,i,h,p,f,M,D,N),r&&(r.faceIndex=Math.floor(C/3),r.face.materialIndex=v.materialIndex,t.push(r))}}else{const _=Math.max(0,g.start),w=Math.min(u.count,g.start+g.count);for(let v=_,x=w;v<x;v+=3){const S=v,b=v+1,C=v+2;r=Hf(this,l,e,i,h,p,f,S,b,C),r&&(r.faceIndex=Math.floor(v/3),t.push(r))}}}}function fD(n,e,t,i,r,a,l,o){let u;if(e.side===GE?u=i.intersectTriangle(l,a,r,!0,o):u=i.intersectTriangle(r,a,l,e.side===r0,o),u===null)return null;Uf.copy(o),Uf.applyMatrix4(n.matrixWorld);const h=t.ray.origin.distanceTo(Uf);return h<t.near||h>t.far?null:{distance:h,point:Uf.clone(),object:n}}function Hf(n,e,t,i,r,a,l,o,u,h){n.getVertexPosition(o,zf),n.getVertexPosition(u,Pf),n.getVertexPosition(h,Ff);const p=fD(n,e,t,i,zf,Pf,Ff,nw);if(p){const f=new se;Or.getBarycoord(nw,zf,Pf,Ff,f),r&&(p.uv=Or.getInterpolatedAttribute(r,o,u,h,f,new Qe)),a&&(p.uv1=Or.getInterpolatedAttribute(a,o,u,h,f,new Qe)),l&&(p.normal=Or.getInterpolatedAttribute(l,o,u,h,f,new se),p.normal.dot(i.direction)>0&&p.normal.multiplyScalar(-1));const m={a:o,b:u,c:h,normal:new se,materialIndex:0};Or.getNormal(zf,Pf,Ff,m.normal),p.face=m,p.barycoord=f}return p}class Kn extends an{constructor(e=1,t=1,i=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:a,depthSegments:l};const o=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],h=[],p=[],f=[];let m=0,g=0;_("z","y","x",-1,-1,i,t,e,l,a,0),_("z","y","x",1,-1,i,t,-e,l,a,1),_("x","z","y",1,1,e,i,t,r,l,2),_("x","z","y",1,-1,e,i,-t,r,l,3),_("x","y","z",1,-1,e,t,i,r,a,4),_("x","y","z",-1,-1,e,t,-i,r,a,5),this.setIndex(u),this.setAttribute("position",new xt(h,3)),this.setAttribute("normal",new xt(p,3)),this.setAttribute("uv",new xt(f,2));function _(w,v,x,S,b,C,O,M,D,N,B){const U=C/D,Y=O/N,K=C/2,H=O/2,J=M/2,Q=D+1,Z=N+1;let ie=0,ne=0;const P=new se;for(let L=0;L<Z;L++){const F=L*Y-H;for(let $=0;$<Q;$++){const W=$*U-K;P[w]=W*S,P[v]=F*b,P[x]=J,h.push(P.x,P.y,P.z),P[w]=0,P[v]=0,P[x]=M>0?1:-1,p.push(P.x,P.y,P.z),f.push($/D),f.push(1-L/N),ie+=1}}for(let L=0;L<N;L++)for(let F=0;F<D;F++){const $=m+F+Q*L,W=m+F+Q*(L+1),ye=m+(F+1)+Q*(L+1),be=m+(F+1)+Q*L;u.push($,W,be),u.push(W,ye,be),ne+=6}o.addGroup(g,ne,B),g+=ne,m+=ie}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Kn(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function gm(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(zt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function pD(n){const e={};for(let t=0;t<n.length;t++){const i=gm(n[t]);for(const r in i)e[r]=i[r]}return e}function mD(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function qK(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rr.workingColorSpace}const VK={clone:gm,merge:pD};var gD=`void main() {
15
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
16
+ }`,yD=`void main() {
17
+ gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
18
+ }`;class Z0 extends lr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=gD,this.fragmentShader=yD,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=gm(e.uniforms),this.uniformsGroups=mD(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?t.uniforms[r]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[r]={type:"m4",value:l.toArray()}:t.uniforms[r]={value:l}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class J0 extends Cn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tn,this.projectionMatrix=new tn,this.projectionMatrixInverse=new tn,this.coordinateSystem=Ys,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ro=new se,iw=new Qe,rw=new Qe;class Qr extends J0{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Yh*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Cl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Yh*2*Math.atan(Math.tan(Cl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Ro.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ro.x,Ro.y).multiplyScalar(-e/Ro.z),Ro.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ro.x,Ro.y).multiplyScalar(-e/Ro.z)}getViewSize(e,t){return this.getViewBounds(e,iw,rw),t.subVectors(rw,iw)}setViewOffset(e,t,i,r,a,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Cl*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,a=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,h=l.fullHeight;a+=l.offsetX*r/u,t-=l.offsetY*i/h,r*=l.width/u,i*=l.height/h}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ic=-90,Lc=1;class _D extends Cn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Qr(Ic,Lc,e,t);r.layers=this.layers,this.add(r);const a=new Qr(Ic,Lc,e,t);a.layers=this.layers,this.add(a);const l=new Qr(Ic,Lc,e,t);l.layers=this.layers,this.add(l);const o=new Qr(Ic,Lc,e,t);o.layers=this.layers,this.add(o);const u=new Qr(Ic,Lc,e,t);u.layers=this.layers,this.add(u);const h=new Qr(Ic,Lc,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,a,l,o,u]=t;for(const h of t)this.remove(h);if(e===Ys)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===Kh)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,l,o,u,h,p]=this.children,f=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,a),e.setRenderTarget(i,1,r),e.render(t,l),e.setRenderTarget(i,2,r),e.render(t,o),e.setRenderTarget(i,3,r),e.render(t,u),e.setRenderTarget(i,4,r),e.render(t,h),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,r),e.render(t,p),e.setRenderTarget(f,m,g),e.xr.enabled=_,i.texture.needsPMREMUpdate=!0}}class Q0 extends vi{constructor(e=[],t=fm,i,r,a,l,o,u,h,p){super(e,t,i,r,a,l,o,u,h,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WK extends X0{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Q0(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`
19
+
20
+ varying vec3 vWorldDirection;
21
+
22
+ vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
23
+
24
+ return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
25
+
26
+ }
27
+
28
+ void main() {
29
+
30
+ vWorldDirection = transformDirection( position, modelMatrix );
31
+
32
+ #include <begin_vertex>
33
+ #include <project_vertex>
34
+
35
+ }
36
+ `,fragmentShader:`
37
+
38
+ uniform sampler2D tEquirect;
39
+
40
+ varying vec3 vWorldDirection;
41
+
42
+ #include <common>
43
+
44
+ void main() {
45
+
46
+ vec3 direction = normalize( vWorldDirection );
47
+
48
+ vec2 sampleUV = equirectUv( direction );
49
+
50
+ gl_FragColor = texture2D( tEquirect, sampleUV );
51
+
52
+ }
53
+ `},r=new Kn(5,5,5),a=new Z0({name:"CubemapFromEquirect",uniforms:gm(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:GE,blending:x3});a.uniforms.tEquirect.value=t;const l=new Cs(r,a),o=t.minFilter;return t.minFilter===pm&&(t.minFilter=ts),new _D(1,10,this).update(e,l),t.minFilter=o,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,i=!0,r=!0){const a=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,i,r);e.setRenderTarget(a)}}class Dh extends Cn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const bD={type:"move"};class $K{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Dh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Dh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Dh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,a=null,l=null;const o=this._targetRay,u=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){l=!0;for(const w of e.hand.values()){const v=t.getJointPose(w,i),x=this._getHandJoint(h,w);v!==null&&(x.matrix.fromArray(v.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=v.radius),x.visible=v!==null}const p=h.joints["index-finger-tip"],f=h.joints["thumb-tip"],m=p.position.distanceTo(f.position),g=.02,_=.005;h.inputState.pinching&&m>g+_?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=g-_&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&a!==null&&(r=a),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(bD)))}return o!==null&&(o.visible=r!==null),u!==null&&(u.visible=a!==null),h!==null&&(h.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Dh;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class eb{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Vt(e),this.density=t}clone(){return new eb(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class tb{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Vt(e),this.near=t,this.far=i}clone(){return new tb(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class vD extends Cn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Js,this.environmentIntensity=1,this.environmentRotation=new Js,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class nb{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=jp,this.updateRanges=[],this.version=0,this.uuid=Dr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,a=this.stride;r<a;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Dr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Dr()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const nr=new se;class ru{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.applyMatrix4(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.applyNormalMatrix(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)nr.fromBufferAttribute(this,t),nr.transformDirection(e),this.setXYZ(t,nr.x,nr.y,nr.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=sr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Zt(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=sr(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=sr(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=sr(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=sr(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),i=Zt(i,this.array),r=Zt(r,this.array),a=Zt(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=a,this}clone(e){if(e===void 0){jS("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return new ii(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ru(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){jS("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class i2 extends lr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Vt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Bc;const yh=new se,zc=new se,Pc=new se,Fc=new Qe,_h=new Qe,r2=new tn,qf=new se,bh=new se,Vf=new se,sw=new Qe,e_=new Qe,aw=new Qe;class xD extends Cn{constructor(e=new i2){if(super(),this.isSprite=!0,this.type="Sprite",Bc===void 0){Bc=new an;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new nb(t,5);Bc.setIndex([0,1,2,0,2,3]),Bc.setAttribute("position",new ru(i,3,0,!1)),Bc.setAttribute("uv",new ru(i,2,3,!1))}this.geometry=Bc,this.material=e,this.center=new Qe(.5,.5),this.count=1}raycast(e,t){e.camera===null&&wn('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),zc.setFromMatrixScale(this.matrixWorld),r2.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Pc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&zc.multiplyScalar(-Pc.z);const i=this.material.rotation;let r,a;i!==0&&(a=Math.cos(i),r=Math.sin(i));const l=this.center;Wf(qf.set(-.5,-.5,0),Pc,l,zc,r,a),Wf(bh.set(.5,-.5,0),Pc,l,zc,r,a),Wf(Vf.set(.5,.5,0),Pc,l,zc,r,a),sw.set(0,0),e_.set(1,0),aw.set(1,1);let o=e.ray.intersectTriangle(qf,bh,Vf,!1,yh);if(o===null&&(Wf(bh.set(-.5,.5,0),Pc,l,zc,r,a),e_.set(0,1),o=e.ray.intersectTriangle(qf,Vf,bh,!1,yh),o===null))return;const u=e.ray.origin.distanceTo(yh);u<e.near||u>e.far||t.push({distance:u,point:yh.clone(),uv:Or.getInterpolation(yh,qf,bh,Vf,sw,e_,aw,new Qe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Wf(n,e,t,i,r,a){Fc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(_h.x=a*Fc.x-r*Fc.y,_h.y=r*Fc.x+a*Fc.y):_h.copy(Fc),n.copy(e),n.x+=_h.x,n.y+=_h.y,n.applyMatrix4(r2)}const $f=new se,ow=new se;class SD extends Cn{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const a=t[i];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);const r=this.levels;let a;for(a=0;a<r.length&&!(t<r[a].distance);a++);return r.splice(a,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){const r=t.splice(i,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),e<a)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){$f.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo($f);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){$f.setFromMatrixPosition(e.matrixWorld),ow.setFromMatrixPosition(this.matrixWorld);const i=$f.distanceTo(ow)/e.zoom;t[0].object.visible=!0;let r,a;for(r=1,a=t.length;r<a;r++){let l=t[r].distance;if(t[r].object.visible&&(l-=l*t[r].hysteresis),i>=l)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<a;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,a=i.length;r<a;r++){const l=i[r];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}const lw=new se,cw=new is,uw=new is,wD=new se,hw=new tn,Gf=new se,t_=new Xi,dw=new tn,n_=new ad;class CD extends Cs{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=LS,this.bindMatrix=new tn,this.bindMatrixInverse=new tn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new or),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Gf),this.boundingBox.expandByPoint(Gf)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Xi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,Gf),this.boundingSphere.expandByPoint(Gf)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),t_.copy(this.boundingSphere),t_.applyMatrix4(r),e.ray.intersectsSphere(t_)!==!1&&(dw.copy(r).invert(),n_.copy(e.ray).applyMatrix4(dw),!(this.boundingBox!==null&&n_.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,n_)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new is,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===LS?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===S3?this.bindMatrixInverse.copy(this.bindMatrix).invert():zt("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;cw.fromBufferAttribute(r.attributes.skinIndex,e),uw.fromBufferAttribute(r.attributes.skinWeight,e),lw.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){const l=uw.getComponent(a);if(l!==0){const o=cw.getComponent(a);hw.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),t.addScaledVector(wD.copy(lw).applyMatrix4(hw),l)}}return t.applyMatrix4(this.bindMatrixInverse)}}class s2 extends Cn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Fa extends vi{constructor(e=null,t=1,i=1,r,a,l,o,u,h=Br,p=Br,f,m){super(null,l,o,u,h,p,r,a,f,m),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const fw=new tn,ED=new tn;class ib{constructor(e=[],t=[]){this.uuid=Dr(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){zt("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new tn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new tn;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let a=0,l=e.length;a<l;a++){const o=e[a]?e[a].matrixWorld:ED;fw.multiplyMatrices(o,t[a]),fw.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new ib(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Fa(t,e,e,Gh,iu);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const a=e.bones[i];let l=t[a];l===void 0&&(zt("Skeleton: No bone found with UUID:",a),l=new s2),this.bones.push(l),this.boneInverses.push(new tn().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,a=t.length;r<a;r++){const l=t[r];e.bones.push(l.uuid);const o=i[r];e.boneInverses.push(o.toArray())}return e}}class Xh extends ii{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const jc=new tn,pw=new tn,Kf=[],mw=new or,kD=new tn,vh=new Cs,xh=new Xi;class AD extends Cs{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Xh(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,kD)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new or),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,jc),mw.copy(e.boundingBox).applyMatrix4(jc),this.boundingBox.union(mw)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Xi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,jc),xh.copy(e.boundingSphere).applyMatrix4(jc),this.boundingSphere.union(xh)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,a=i.length+1,l=e*a+1;for(let o=0;o<i.length;o++)i[o]=r[l+o]}raycast(e,t){const i=this.matrixWorld,r=this.count;if(vh.geometry=this.geometry,vh.material=this.material,vh.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),xh.copy(this.boundingSphere),xh.applyMatrix4(i),e.ray.intersectsSphere(xh)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,jc),pw.multiplyMatrices(i,jc),vh.matrixWorld=pw,vh.raycast(e,Kf);for(let l=0,o=Kf.length;l<o;l++){const u=Kf[l];u.instanceId=a,u.object=this,t.push(u)}Kf.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Xh(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new Fa(new Float32Array(r*this.count),r,this.count,KE,iu));const a=this.morphTexture.source.data.data;let l=0;for(let h=0;h<i.length;h++)l+=i[h];const o=this.geometry.morphTargetsRelative?1:1-l,u=r*e;a[u]=o,a.set(i,u+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const i_=new se,TD=new se,MD=new ea;class Uc{constructor(e=new se(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=i_.subVectors(i,t).cross(TD.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(i_),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||MD.getNormalMatrix(e),r=this.coplanarPoint(i_).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const hl=new Xi,RD=new Qe(.5,.5),Yf=new se;class rb{constructor(e=new Uc,t=new Uc,i=new Uc,r=new Uc,a=new Uc,l=new Uc){this.planes=[e,t,i,r,a,l]}set(e,t,i,r,a,l){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(a),o[5].copy(l),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ys,i=!1){const r=this.planes,a=e.elements,l=a[0],o=a[1],u=a[2],h=a[3],p=a[4],f=a[5],m=a[6],g=a[7],_=a[8],w=a[9],v=a[10],x=a[11],S=a[12],b=a[13],C=a[14],O=a[15];if(r[0].setComponents(h-l,g-p,x-_,O-S).normalize(),r[1].setComponents(h+l,g+p,x+_,O+S).normalize(),r[2].setComponents(h+o,g+f,x+w,O+b).normalize(),r[3].setComponents(h-o,g-f,x-w,O-b).normalize(),i)r[4].setComponents(u,m,v,C).normalize(),r[5].setComponents(h-u,g-m,x-v,O-C).normalize();else if(r[4].setComponents(h-u,g-m,x-v,O-C).normalize(),t===Ys)r[5].setComponents(h+u,g+m,x+v,O+C).normalize();else if(t===Kh)r[5].setComponents(u,m,v,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),hl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),hl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(hl)}intersectsSprite(e){hl.center.set(0,0,0);const t=RD.distanceTo(e.center);return hl.radius=.7071067811865476+t,hl.applyMatrix4(e.matrixWorld),this.intersectsSphere(hl)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Yf.x=r.normal.x>0?e.max.x:e.min.x,Yf.y=r.normal.y>0?e.max.y:e.min.y,Yf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Yf)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const js=new tn,Us=new rb;class sb{constructor(){this.coordinateSystem=Ys}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(js.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Us.setFromProjectionMatrix(js,r.coordinateSystem,r.reversedDepth),Us.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(js.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Us.setFromProjectionMatrix(js,r.coordinateSystem,r.reversedDepth),Us.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(js.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Us.setFromProjectionMatrix(js,r.coordinateSystem,r.reversedDepth),Us.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(js.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Us.setFromProjectionMatrix(js,r.coordinateSystem,r.reversedDepth),Us.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){const r=t.cameras[i];if(js.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Us.setFromProjectionMatrix(js,r.coordinateSystem,r.reversedDepth),Us.containsPoint(e))return!0}return!1}clone(){return new sb}}function r_(n,e){return n-e}function OD(n,e){return n.z-e.z}function ND(n,e){return e.z-n.z}class DD{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){const a=this.pool,l=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];l.push(o),this.index++,o.start=e,o.count=t,o.z=i,o.index=r}reset(){this.list.length=0,this.index=0}}const gr=new tn,ID=new Vt(1,1,1),gw=new rb,LD=new sb,Xf=new or,dl=new Xi,Sh=new se,yw=new se,BD=new se,s_=new DD,Ki=new Cs,Zf=[];function zD(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let a=0;a<r;a++)for(let l=0;l<i;l++)e.setComponent(a+t,l,n.getComponent(a,l))}else e.array.set(n.array,t*i);e.needsUpdate=!0}function fl(n,e){if(n.constructor!==e.constructor){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)e[i]=n[i]}else{const t=Math.min(n.length,e.length);e.set(new n.constructor(n.buffer,0,t))}}class PD extends Cs{constructor(e,t,i=t*2,r){super(new an,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),i=new Fa(t,e,e,Gh,iu);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),i=new Fa(t,e,e,YE,mm);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),i=new Fa(t,e,e,Gh,iu);i.colorSpace=Rr.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const t=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const l=e.getAttribute(a),{array:o,itemSize:u,normalized:h}=l,p=new o.constructor(i*u),f=new ii(p,u,h);t.setAttribute(a,f)}if(e.getIndex()!==null){const a=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new ii(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),a=t.getAttribute(i);if(r.itemSize!==a.itemSize||r.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new or);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const a=t[i].geometryIndex;this.getMatrixAt(i,gr),this.getBoundingBoxAt(a,Xf).applyMatrix4(gr),e.union(Xf)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Xi);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;const a=t[i].geometryIndex;this.getMatrixAt(i,gr),this.getBoundingSphereAt(a,dl).applyMatrix4(gr),e.union(dl)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(r_),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const a=this._matricesTexture;gr.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;const l=this._colorsTexture;return l&&(ID.toArray(l.image.data,r*4),l.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?l.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let u;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(r_),u=this._availableGeometryIds.shift(),a[u]=r):(u=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(u,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,u}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,a=i.getIndex(),l=t.getIndex(),o=this._geometryInfo[e];if(r&&l.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const u=o.vertexStart,h=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const p in i.attributes){const f=t.getAttribute(p),m=i.getAttribute(p);zD(f,m,u);const g=f.itemSize;for(let _=f.count,w=h;_<w;_++){const v=u+_;for(let x=0;x<g;x++)m.setComponent(v,x,0)}m.needsUpdate=!0,m.addUpdateRange(u*g,h*g)}if(r){const p=o.indexStart,f=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let m=0;m<l.count;m++)a.setX(p+m,u+l.getX(m));for(let m=l.count,g=f;m<g;m++)a.setX(p+m,u);a.needsUpdate=!0,a.addUpdateRange(p,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let r=0,a=i.length;r<a;r++)i[r].active&&i[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const i=this._geometryInfo,r=i.map((l,o)=>o).sort((l,o)=>i[l].vertexStart-i[o].vertexStart),a=this.geometry;for(let l=0,o=i.length;l<o;l++){const u=r[l],h=i[u];if(h.active!==!1){if(a.index!==null){if(h.indexStart!==t){const{indexStart:p,vertexStart:f,reservedIndexCount:m}=h,g=a.index,_=g.array,w=e-f;for(let v=p;v<p+m;v++)_[v]=_[v]+w;g.array.copyWithin(t,p,p+m),g.addUpdateRange(t,m),g.needsUpdate=!0,h.indexStart=t}t+=h.reservedIndexCount}if(h.vertexStart!==e){const{vertexStart:p,reservedVertexCount:f}=h,m=a.attributes;for(const g in m){const _=m[g],{array:w,itemSize:v}=_;w.copyWithin(e*v,p*v,(p+f)*v),_.addUpdateRange(e*v,f*v),_.needsUpdate=!0}h.vertexStart=e}e+=h.reservedVertexCount,h.start=a.index?h.indexStart:h.vertexStart,this._nextIndexStart=a.index?h.indexStart+h.reservedIndexCount:0,this._nextVertexStart=h.vertexStart+h.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const a=new or,l=i.index,o=i.attributes.position;for(let u=r.start,h=r.start+r.count;u<h;u++){let p=u;l&&(p=l.getX(p)),a.expandByPoint(Sh.fromBufferAttribute(o,p))}r.boundingBox=a}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const a=new Xi;this.getBoundingBoxAt(e,Xf),Xf.getCenter(a.center);const l=i.index,o=i.attributes.position;let u=0;for(let h=r.start,p=r.start+r.count;h<p;h++){let f=h;l&&(f=l.getX(f)),Sh.fromBufferAttribute(o,f),u=Math.max(u,a.center.distanceToSquared(Sh))}a.radius=Math.sqrt(u),r.boundingSphere=a}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const i=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){const t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(r_);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),a=new Int32Array(e);fl(this._multiDrawCounts,r),fl(this._multiDrawStarts,a),this._multiDrawCounts=r,this._multiDrawStarts=a,this._maxInstanceCount=e;const l=this._indirectTexture,o=this._matricesTexture,u=this._colorsTexture;l.dispose(),this._initIndirectTexture(),fl(l.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),fl(o.image.data,this._matricesTexture.image.data),u&&(u.dispose(),this._initColorsTexture(),fl(u.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const i=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(u=>u.indexStart+u.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new an,this._initializeGeometry(a));const l=this.geometry;a.index&&fl(a.index.array,l.index.array);for(const o in a.attributes)fl(a.attributes[o].array,l.attributes[o].array)}raycast(e,t){const i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,l=this.geometry;Ki.material=this.material,Ki.geometry.index=l.index,Ki.geometry.attributes=l.attributes,Ki.geometry.boundingBox===null&&(Ki.geometry.boundingBox=new or),Ki.geometry.boundingSphere===null&&(Ki.geometry.boundingSphere=new Xi);for(let o=0,u=i.length;o<u;o++){if(!i[o].visible||!i[o].active)continue;const h=i[o].geometryIndex,p=r[h];Ki.geometry.setDrawRange(p.start,p.count),this.getMatrixAt(o,Ki.matrixWorld).premultiply(a),this.getBoundingBoxAt(h,Ki.geometry.boundingBox),this.getBoundingSphereAt(h,Ki.geometry.boundingSphere),Ki.raycast(e,Zf);for(let f=0,m=Zf.length;f<m;f++){const g=Zf[f];g.object=this,g.batchId=o,t.push(g)}Zf.length=0}Ki.material=null,Ki.geometry.index=null,Ki.geometry.attributes={},Ki.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,r,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=r.getIndex(),o=l===null?1:l.array.BYTES_PER_ELEMENT,u=this._instanceInfo,h=this._multiDrawStarts,p=this._multiDrawCounts,f=this._geometryInfo,m=this.perObjectFrustumCulled,g=this._indirectTexture,_=g.image.data,w=i.isArrayCamera?LD:gw;m&&!i.isArrayCamera&&(gr.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),gw.setFromProjectionMatrix(gr,i.coordinateSystem,i.reversedDepth));let v=0;if(this.sortObjects){gr.copy(this.matrixWorld).invert(),Sh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(gr),yw.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(gr);for(let b=0,C=u.length;b<C;b++)if(u[b].visible&&u[b].active){const O=u[b].geometryIndex;this.getMatrixAt(b,gr),this.getBoundingSphereAt(O,dl).applyMatrix4(gr);let M=!1;if(m&&(M=!w.intersectsSphere(dl,i)),!M){const D=f[O],N=BD.subVectors(dl.center,Sh).dot(yw);s_.push(D.start,D.count,N,b)}}const x=s_.list,S=this.customSort;S===null?x.sort(a.transparent?ND:OD):S.call(this,x,i);for(let b=0,C=x.length;b<C;b++){const O=x[b];h[v]=O.start*o,p[v]=O.count,_[v]=O.index,v++}s_.reset()}else for(let x=0,S=u.length;x<S;x++)if(u[x].visible&&u[x].active){const b=u[x].geometryIndex;let C=!1;if(m&&(this.getMatrixAt(x,gr),this.getBoundingSphereAt(b,dl).applyMatrix4(gr),C=!w.intersectsSphere(dl,i)),!C){const O=f[b];h[v]=O.start*o,p[v]=O.count,_[v]=x,v++}}g.needsUpdate=!0,this._multiDrawCount=v,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,a,l){this.onBeforeRender(e,null,r,a,l)}}class cr extends lr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Vt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Hp=new se,qp=new se,_w=new tn,wh=new ad,Jf=new Xi,a_=new se,bw=new se;class El extends Cn{constructor(e=new an,t=new cr){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,a=t.count;r<a;r++)Hp.fromBufferAttribute(t,r-1),qp.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Hp.distanceTo(qp);e.setAttribute("lineDistance",new xt(i,1))}else zt("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold,l=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Jf.copy(i.boundingSphere),Jf.applyMatrix4(r),Jf.radius+=a,e.ray.intersectsSphere(Jf)===!1)return;_w.copy(r).invert(),wh.copy(e.ray).applyMatrix4(_w);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=o*o,h=this.isLineSegments?2:1,p=i.index,m=i.attributes.position;if(p!==null){const g=Math.max(0,l.start),_=Math.min(p.count,l.start+l.count);for(let w=g,v=_-1;w<v;w+=h){const x=p.getX(w),S=p.getX(w+1),b=Qf(this,e,wh,u,x,S,w);b&&t.push(b)}if(this.isLineLoop){const w=p.getX(_-1),v=p.getX(g),x=Qf(this,e,wh,u,w,v,_-1);x&&t.push(x)}}else{const g=Math.max(0,l.start),_=Math.min(m.count,l.start+l.count);for(let w=g,v=_-1;w<v;w+=h){const x=Qf(this,e,wh,u,w,w+1,w);x&&t.push(x)}if(this.isLineLoop){const w=Qf(this,e,wh,u,_-1,g,_-1);w&&t.push(w)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function Qf(n,e,t,i,r,a,l){const o=n.geometry.attributes.position;if(Hp.fromBufferAttribute(o,r),qp.fromBufferAttribute(o,a),t.distanceSqToSegment(Hp,qp,a_,bw)>i)return;a_.applyMatrix4(n.matrixWorld);const h=e.ray.origin.distanceTo(a_);if(!(h<e.near||h>e.far))return{distance:h,point:bw.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const vw=new se,xw=new se;class Ha extends El{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,a=t.count;r<a;r+=2)vw.fromBufferAttribute(t,r),xw.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+vw.distanceTo(xw);e.setAttribute("lineDistance",new xt(i,1))}else zt("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class FD extends El{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class a2 extends lr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Vt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Sw=new tn,c0=new ad,ep=new Xi,tp=new se;class jD extends Cn{constructor(e=new an,t=new a2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold,l=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),ep.copy(i.boundingSphere),ep.applyMatrix4(r),ep.radius+=a,e.ray.intersectsSphere(ep)===!1)return;Sw.copy(r).invert(),c0.copy(e.ray).applyMatrix4(Sw);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=o*o,h=i.index,f=i.attributes.position;if(h!==null){const m=Math.max(0,l.start),g=Math.min(h.count,l.start+l.count);for(let _=m,w=g;_<w;_++){const v=h.getX(_);tp.fromBufferAttribute(f,v),ww(tp,v,u,r,e,t,this)}}else{const m=Math.max(0,l.start),g=Math.min(f.count,l.start+l.count);for(let _=m,w=g;_<w;_++)tp.fromBufferAttribute(f,_),ww(tp,_,u,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function ww(n,e,t,i,r,a,l){const o=c0.distanceSqToPoint(n);if(o<t){const u=new se;c0.closestPointToPoint(n,u),u.applyMatrix4(i);const h=r.ray.origin.distanceTo(u);if(h<r.near||h>r.far)return;a.push({distance:h,distanceToRay:Math.sqrt(o),point:u,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class UD extends vi{constructor(e,t,i,r,a=ts,l=ts,o,u,h){super(e,t,i,r,a,l,o,u,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const p=this;function f(){p.needsUpdate=!0,p._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class GK extends UD{constructor(e,t,i,r,a,l,o,u){super({},e,t,i,r,a,l,o,u),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class KK extends vi{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Br,this.minFilter=Br,this.generateMipmaps=!1,this.needsUpdate=!0}}class ab extends vi{constructor(e,t,i,r,a,l,o,u,h,p,f,m){super(null,l,o,u,h,p,r,a,f,m),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class YK extends ab{constructor(e,t,i,r,a,l){super(e,t,i,a,l),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Ks,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class XK extends ab{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,fm),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class ZK extends vi{constructor(e,t,i,r,a,l,o,u,h){super(e,t,i,r,a,l,o,u,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class HD extends vi{constructor(e,t,i=mm,r,a,l,o=Br,u=Br,h,p=o0,f=1){if(p!==o0&&p!==U3)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:t,depth:f};super(m,r,a,l,o,u,p,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Sl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class JK extends HD{constructor(e,t=mm,i=fm,r,a,l=Br,o=Br,u,h=o0){const p={width:e,height:e,depth:1},f=[p,p,p,p,p,p];super(e,e,t,i,r,a,l,o,u,h),this.image=f,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class QK extends vi{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ob extends an{constructor(e=1,t=1,i=4,r=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r,heightSegments:a},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),a=Math.max(1,Math.floor(a));const l=[],o=[],u=[],h=[],p=t/2,f=Math.PI/2*e,m=t,g=2*f+m,_=i*2+a,w=r+1,v=new se,x=new se;for(let S=0;S<=_;S++){let b=0,C=0,O=0,M=0;if(S<=i){const B=S/i,U=B*Math.PI/2;C=-p-e*Math.cos(U),O=e*Math.sin(U),M=-e*Math.cos(U),b=B*f}else if(S<=i+a){const B=(S-i)/a;C=-p+B*t,O=e,M=0,b=f+B*m}else{const B=(S-i-a)/i,U=B*Math.PI/2;C=p+e*Math.sin(U),O=e*Math.cos(U),M=e*Math.sin(U),b=f+m+B*f}const D=Math.max(0,Math.min(1,b/g));let N=0;S===0?N=.5/r:S===_&&(N=-.5/r);for(let B=0;B<=r;B++){const U=B/r,Y=U*Math.PI*2,K=Math.sin(Y),H=Math.cos(Y);x.x=-O*H,x.y=C,x.z=O*K,o.push(x.x,x.y,x.z),v.set(-O*H,M,O*K),v.normalize(),u.push(v.x,v.y,v.z),h.push(U+N,D)}if(S>0){const B=(S-1)*w;for(let U=0;U<r;U++){const Y=B+U,K=B+U+1,H=S*w+U,J=S*w+U+1;l.push(Y,K,H),l.push(K,J,H)}}}this.setIndex(l),this.setAttribute("position",new xt(o,3)),this.setAttribute("normal",new xt(u,3)),this.setAttribute("uv",new xt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ob(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class lb extends an{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const a=[],l=[],o=[],u=[],h=new se,p=new Qe;l.push(0,0,0),o.push(0,0,1),u.push(.5,.5);for(let f=0,m=3;f<=t;f++,m+=3){const g=i+f/t*r;h.x=e*Math.cos(g),h.y=e*Math.sin(g),l.push(h.x,h.y,h.z),o.push(0,0,1),p.x=(l[m]/e+1)/2,p.y=(l[m+1]/e+1)/2,u.push(p.x,p.y)}for(let f=1;f<=t;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new xt(l,3)),this.setAttribute("normal",new xt(o,3)),this.setAttribute("uv",new xt(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lb(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class od extends an{constructor(e=1,t=1,i=1,r=32,a=1,l=!1,o=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:a,openEnded:l,thetaStart:o,thetaLength:u};const h=this;r=Math.floor(r),a=Math.floor(a);const p=[],f=[],m=[],g=[];let _=0;const w=[],v=i/2;let x=0;S(),l===!1&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(p),this.setAttribute("position",new xt(f,3)),this.setAttribute("normal",new xt(m,3)),this.setAttribute("uv",new xt(g,2));function S(){const C=new se,O=new se;let M=0;const D=(t-e)/i;for(let N=0;N<=a;N++){const B=[],U=N/a,Y=U*(t-e)+e;for(let K=0;K<=r;K++){const H=K/r,J=H*u+o,Q=Math.sin(J),Z=Math.cos(J);O.x=Y*Q,O.y=-U*i+v,O.z=Y*Z,f.push(O.x,O.y,O.z),C.set(Q,D,Z).normalize(),m.push(C.x,C.y,C.z),g.push(H,1-U),B.push(_++)}w.push(B)}for(let N=0;N<r;N++)for(let B=0;B<a;B++){const U=w[B][N],Y=w[B+1][N],K=w[B+1][N+1],H=w[B][N+1];(e>0||B!==0)&&(p.push(U,Y,H),M+=3),(t>0||B!==a-1)&&(p.push(Y,K,H),M+=3)}h.addGroup(x,M,0),x+=M}function b(C){const O=_,M=new Qe,D=new se;let N=0;const B=C===!0?e:t,U=C===!0?1:-1;for(let K=1;K<=r;K++)f.push(0,v*U,0),m.push(0,U,0),g.push(.5,.5),_++;const Y=_;for(let K=0;K<=r;K++){const J=K/r*u+o,Q=Math.cos(J),Z=Math.sin(J);D.x=B*Z,D.y=v*U,D.z=B*Q,f.push(D.x,D.y,D.z),m.push(0,U,0),M.x=Q*.5+.5,M.y=Z*.5*U+.5,g.push(M.x,M.y),_++}for(let K=0;K<r;K++){const H=O+K,J=Y+K;C===!0?p.push(J,J+1,H):p.push(J+1,J,H),N+=3}h.addGroup(x,N,C===!0?1:2),x+=N}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new od(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ym extends od{constructor(e=1,t=1,i=32,r=1,a=!1,l=0,o=Math.PI*2){super(0,e,t,i,r,a,l,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:l,thetaLength:o}}static fromJSON(e){return new ym(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ml extends an{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const a=[],l=[];o(r),h(i),p(),this.setAttribute("position",new xt(a,3)),this.setAttribute("normal",new xt(a.slice(),3)),this.setAttribute("uv",new xt(l,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(S){const b=new se,C=new se,O=new se;for(let M=0;M<t.length;M+=3)g(t[M+0],b),g(t[M+1],C),g(t[M+2],O),u(b,C,O,S)}function u(S,b,C,O){const M=O+1,D=[];for(let N=0;N<=M;N++){D[N]=[];const B=S.clone().lerp(C,N/M),U=b.clone().lerp(C,N/M),Y=M-N;for(let K=0;K<=Y;K++)K===0&&N===M?D[N][K]=B:D[N][K]=B.clone().lerp(U,K/Y)}for(let N=0;N<M;N++)for(let B=0;B<2*(M-N)-1;B++){const U=Math.floor(B/2);B%2===0?(m(D[N][U+1]),m(D[N+1][U]),m(D[N][U])):(m(D[N][U+1]),m(D[N+1][U+1]),m(D[N+1][U]))}}function h(S){const b=new se;for(let C=0;C<a.length;C+=3)b.x=a[C+0],b.y=a[C+1],b.z=a[C+2],b.normalize().multiplyScalar(S),a[C+0]=b.x,a[C+1]=b.y,a[C+2]=b.z}function p(){const S=new se;for(let b=0;b<a.length;b+=3){S.x=a[b+0],S.y=a[b+1],S.z=a[b+2];const C=v(S)/2/Math.PI+.5,O=x(S)/Math.PI+.5;l.push(C,1-O)}_(),f()}function f(){for(let S=0;S<l.length;S+=6){const b=l[S+0],C=l[S+2],O=l[S+4],M=Math.max(b,C,O),D=Math.min(b,C,O);M>.9&&D<.1&&(b<.2&&(l[S+0]+=1),C<.2&&(l[S+2]+=1),O<.2&&(l[S+4]+=1))}}function m(S){a.push(S.x,S.y,S.z)}function g(S,b){const C=S*3;b.x=e[C+0],b.y=e[C+1],b.z=e[C+2]}function _(){const S=new se,b=new se,C=new se,O=new se,M=new Qe,D=new Qe,N=new Qe;for(let B=0,U=0;B<a.length;B+=9,U+=6){S.set(a[B+0],a[B+1],a[B+2]),b.set(a[B+3],a[B+4],a[B+5]),C.set(a[B+6],a[B+7],a[B+8]),M.set(l[U+0],l[U+1]),D.set(l[U+2],l[U+3]),N.set(l[U+4],l[U+5]),O.copy(S).add(b).add(C).divideScalar(3);const Y=v(O);w(M,U+0,S,Y),w(D,U+2,b,Y),w(N,U+4,C,Y)}}function w(S,b,C,O){O<0&&S.x===1&&(l[b]=S.x-1),C.x===0&&C.z===0&&(l[b]=O/2/Math.PI+.5)}function v(S){return Math.atan2(S.z,-S.x)}function x(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ml(e.vertices,e.indices,e.radius,e.detail)}}class cb extends Ml{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],l=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new cb(e.radius,e.detail)}}const np=new se,ip=new se,o_=new se,rp=new Or;class Ih extends an{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),a=Math.cos(Cl*t),l=e.getIndex(),o=e.getAttribute("position"),u=l?l.count:o.count,h=[0,0,0],p=["a","b","c"],f=new Array(3),m={},g=[];for(let _=0;_<u;_+=3){l?(h[0]=l.getX(_),h[1]=l.getX(_+1),h[2]=l.getX(_+2)):(h[0]=_,h[1]=_+1,h[2]=_+2);const{a:w,b:v,c:x}=rp;if(w.fromBufferAttribute(o,h[0]),v.fromBufferAttribute(o,h[1]),x.fromBufferAttribute(o,h[2]),rp.getNormal(o_),f[0]=`${Math.round(w.x*r)},${Math.round(w.y*r)},${Math.round(w.z*r)}`,f[1]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,f[2]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let S=0;S<3;S++){const b=(S+1)%3,C=f[S],O=f[b],M=rp[p[S]],D=rp[p[b]],N=`${C}_${O}`,B=`${O}_${C}`;B in m&&m[B]?(o_.dot(m[B].normal)<=a&&(g.push(M.x,M.y,M.z),g.push(D.x,D.y,D.z)),m[B]=null):N in m||(m[N]={index0:h[S],index1:h[b],normal:o_.clone()})}}for(const _ in m)if(m[_]){const{index0:w,index1:v}=m[_];np.fromBufferAttribute(o,w),ip.fromBufferAttribute(o,v),g.push(np.x,np.y,np.z),g.push(ip.x,ip.y,ip.z)}this.setAttribute("position",new xt(g,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class ta{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){zt("Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),a=0;t.push(0);for(let l=1;l<=e;l++)i=this.getPoint(l/e),a+=i.distanceTo(r),t.push(a),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let r=0;const a=i.length;let l;t?l=t:l=e*i[a-1];let o=0,u=a-1,h;for(;o<=u;)if(r=Math.floor(o+(u-o)/2),h=i[r]-l,h<0)o=r+1;else if(h>0)u=r-1;else{u=r;break}if(r=u,i[r]===l)return r/(a-1);const p=i[r],m=i[r+1]-p,g=(l-p)/m;return(r+g)/(a-1)}getTangent(e,t){let r=e-1e-4,a=e+1e-4;r<0&&(r=0),a>1&&(a=1);const l=this.getPoint(r),o=this.getPoint(a),u=t||(l.isVector2?new Qe:new se);return u.copy(o).sub(l).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new se,r=[],a=[],l=[],o=new se,u=new tn;for(let g=0;g<=e;g++){const _=g/e;r[g]=this.getTangentAt(_,new se)}a[0]=new se,l[0]=new se;let h=Number.MAX_VALUE;const p=Math.abs(r[0].x),f=Math.abs(r[0].y),m=Math.abs(r[0].z);p<=h&&(h=p,i.set(1,0,0)),f<=h&&(h=f,i.set(0,1,0)),m<=h&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),a[0].crossVectors(r[0],o),l[0].crossVectors(r[0],a[0]);for(let g=1;g<=e;g++){if(a[g]=a[g-1].clone(),l[g]=l[g-1].clone(),o.crossVectors(r[g-1],r[g]),o.length()>Number.EPSILON){o.normalize();const _=Math.acos(jt(r[g-1].dot(r[g]),-1,1));a[g].applyMatrix4(u.makeRotationAxis(o,_))}l[g].crossVectors(r[g],a[g])}if(t===!0){let g=Math.acos(jt(a[0].dot(a[e]),-1,1));g/=e,r[0].dot(o.crossVectors(a[0],a[e]))>0&&(g=-g);for(let _=1;_<=e;_++)a[_].applyMatrix4(u.makeRotationAxis(r[_],g*_)),l[_].crossVectors(r[_],a[_])}return{tangents:r,normals:a,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ub extends ta{constructor(e=0,t=0,i=1,r=1,a=0,l=Math.PI*2,o=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=a,this.aEndAngle=l,this.aClockwise=o,this.aRotation=u}getPoint(e,t=new Qe){const i=t,r=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const l=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(l?a=0:a=r),this.aClockwise===!0&&!l&&(a===r?a=-r:a=a-r);const o=this.aStartAngle+e*a;let u=this.aX+this.xRadius*Math.cos(o),h=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const p=Math.cos(this.aRotation),f=Math.sin(this.aRotation),m=u-this.aX,g=h-this.aY;u=m*p-g*f+this.aX,h=m*f+g*p+this.aY}return i.set(u,h)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class qD extends ub{constructor(e,t,i,r,a,l){super(e,t,i,i,r,a,l),this.isArcCurve=!0,this.type="ArcCurve"}}function hb(){let n=0,e=0,t=0,i=0;function r(a,l,o,u){n=a,e=o,t=-3*a+3*l-2*o-u,i=2*a-2*l+o+u}return{initCatmullRom:function(a,l,o,u,h){r(l,o,h*(o-a),h*(u-l))},initNonuniformCatmullRom:function(a,l,o,u,h,p,f){let m=(l-a)/h-(o-a)/(h+p)+(o-l)/p,g=(o-l)/p-(u-l)/(p+f)+(u-o)/f;m*=p,g*=p,r(l,o,m,g)},calc:function(a){const l=a*a,o=l*a;return n+e*a+t*l+i*o}}}const sp=new se,l_=new hb,c_=new hb,u_=new hb;class VD extends ta{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new se){const i=t,r=this.points,a=r.length,l=(a-(this.closed?0:1))*e;let o=Math.floor(l),u=l-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:u===0&&o===a-1&&(o=a-2,u=1);let h,p;this.closed||o>0?h=r[(o-1)%a]:(sp.subVectors(r[0],r[1]).add(r[0]),h=sp);const f=r[o%a],m=r[(o+1)%a];if(this.closed||o+2<a?p=r[(o+2)%a]:(sp.subVectors(r[a-1],r[a-2]).add(r[a-1]),p=sp),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let _=Math.pow(h.distanceToSquared(f),g),w=Math.pow(f.distanceToSquared(m),g),v=Math.pow(m.distanceToSquared(p),g);w<1e-4&&(w=1),_<1e-4&&(_=w),v<1e-4&&(v=w),l_.initNonuniformCatmullRom(h.x,f.x,m.x,p.x,_,w,v),c_.initNonuniformCatmullRom(h.y,f.y,m.y,p.y,_,w,v),u_.initNonuniformCatmullRom(h.z,f.z,m.z,p.z,_,w,v)}else this.curveType==="catmullrom"&&(l_.initCatmullRom(h.x,f.x,m.x,p.x,this.tension),c_.initCatmullRom(h.y,f.y,m.y,p.y,this.tension),u_.initCatmullRom(h.z,f.z,m.z,p.z,this.tension));return i.set(l_.calc(u),c_.calc(u),u_.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new se().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Cw(n,e,t,i,r){const a=(i-e)*.5,l=(r-t)*.5,o=n*n,u=n*o;return(2*t-2*i+a+l)*u+(-3*t+3*i-2*a-l)*o+a*n+t}function WD(n,e){const t=1-n;return t*t*e}function $D(n,e){return 2*(1-n)*n*e}function GD(n,e){return n*n*e}function Ph(n,e,t,i){return WD(n,e)+$D(n,t)+GD(n,i)}function KD(n,e){const t=1-n;return t*t*t*e}function YD(n,e){const t=1-n;return 3*t*t*n*e}function XD(n,e){return 3*(1-n)*n*n*e}function ZD(n,e){return n*n*n*e}function Fh(n,e,t,i,r){return KD(n,e)+YD(n,t)+XD(n,i)+ZD(n,r)}class o2 extends ta{constructor(e=new Qe,t=new Qe,i=new Qe,r=new Qe){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Qe){const i=t,r=this.v0,a=this.v1,l=this.v2,o=this.v3;return i.set(Fh(e,r.x,a.x,l.x,o.x),Fh(e,r.y,a.y,l.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class JD extends ta{constructor(e=new se,t=new se,i=new se,r=new se){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new se){const i=t,r=this.v0,a=this.v1,l=this.v2,o=this.v3;return i.set(Fh(e,r.x,a.x,l.x,o.x),Fh(e,r.y,a.y,l.y,o.y),Fh(e,r.z,a.z,l.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class l2 extends ta{constructor(e=new Qe,t=new Qe){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Qe){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Qe){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class QD extends ta{constructor(e=new se,t=new se){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new se){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new se){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class c2 extends ta{constructor(e=new Qe,t=new Qe,i=new Qe){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Qe){const i=t,r=this.v0,a=this.v1,l=this.v2;return i.set(Ph(e,r.x,a.x,l.x),Ph(e,r.y,a.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class u2 extends ta{constructor(e=new se,t=new se,i=new se){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new se){const i=t,r=this.v0,a=this.v1,l=this.v2;return i.set(Ph(e,r.x,a.x,l.x),Ph(e,r.y,a.y,l.y),Ph(e,r.z,a.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class h2 extends ta{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Qe){const i=t,r=this.points,a=(r.length-1)*e,l=Math.floor(a),o=a-l,u=r[l===0?l:l-1],h=r[l],p=r[l>r.length-2?r.length-1:l+1],f=r[l>r.length-3?r.length-1:l+2];return i.set(Cw(o,u.x,h.x,p.x,f.x),Cw(o,u.y,h.y,p.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Qe().fromArray(r))}return this}}var Vp=Object.freeze({__proto__:null,ArcCurve:qD,CatmullRomCurve3:VD,CubicBezierCurve:o2,CubicBezierCurve3:JD,EllipseCurve:ub,LineCurve:l2,LineCurve3:QD,QuadraticBezierCurve:c2,QuadraticBezierCurve3:u2,SplineCurve:h2});class eI extends ta{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Vp[i](t,e))}return this}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let a=0;for(;a<r.length;){if(r[a]>=i){const l=r[a]-i,o=this.curves[a],u=o.getLength(),h=u===0?0:1-l/u;return o.getPointAt(h,t)}a++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,a=this.curves;r<a.length;r++){const l=a[r],o=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,u=l.getPoints(o);for(let h=0;h<u.length;h++){const p=u[h];i&&i.equals(p)||(t.push(p),i=p)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Vp[r.type]().fromJSON(r))}return this}}class u0 extends eI{constructor(e){super(),this.type="Path",this.currentPoint=new Qe,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new l2(this.currentPoint.clone(),new Qe(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const a=new c2(this.currentPoint.clone(),new Qe(e,t),new Qe(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,a,l){const o=new o2(this.currentPoint.clone(),new Qe(e,t),new Qe(i,r),new Qe(a,l));return this.curves.push(o),this.currentPoint.set(a,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new h2(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,a,l){const o=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+o,t+u,i,r,a,l),this}absarc(e,t,i,r,a,l){return this.absellipse(e,t,i,i,r,a,l),this}ellipse(e,t,i,r,a,l,o,u){const h=this.currentPoint.x,p=this.currentPoint.y;return this.absellipse(e+h,t+p,i,r,a,l,o,u),this}absellipse(e,t,i,r,a,l,o,u){const h=new ub(e,t,i,r,a,l,o,u);if(this.curves.length>0){const f=h.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(h);const p=h.getPoint(1);return this.currentPoint.copy(p),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class tu extends u0{constructor(e){super(e),this.uuid=Dr(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new u0().fromJSON(r))}return this}}function tI(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let a=d2(n,0,r,t,!0);const l=[];if(!a||a.next===a.prev)return l;let o,u,h;if(i&&(a=aI(n,e,a,t)),n.length>80*t){o=n[0],u=n[1];let p=o,f=u;for(let m=t;m<r;m+=t){const g=n[m],_=n[m+1];g<o&&(o=g),_<u&&(u=_),g>p&&(p=g),_>f&&(f=_)}h=Math.max(p-o,f-u),h=h!==0?32767/h:0}return Zh(a,l,t,o,u,h,0),l}function d2(n,e,t,i,r){let a;if(r===yI(n,e,t,i)>0)for(let l=e;l<t;l+=i)a=Ew(l/i|0,n[l],n[l+1],a);else for(let l=t-i;l>=e;l-=i)a=Ew(l/i|0,n[l],n[l+1],a);return a&&su(a,a.next)&&(Qh(a),a=a.next),a}function kl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(su(t,t.next)||ni(t.prev,t,t.next)===0)){if(Qh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Zh(n,e,t,i,r,a,l){if(!n)return;!l&&a&&hI(n,i,r,a);let o=n;for(;n.prev!==n.next;){const u=n.prev,h=n.next;if(a?iI(n,i,r,a):nI(n)){e.push(u.i,n.i,h.i),Qh(n),n=h.next,o=h.next;continue}if(n=h,n===o){l?l===1?(n=rI(kl(n),e),Zh(n,e,t,i,r,a,2)):l===2&&sI(n,e,t,i,r,a):Zh(kl(n),e,t,i,r,a,1);break}}}function nI(n){const e=n.prev,t=n,i=n.next;if(ni(e,t,i)>=0)return!1;const r=e.x,a=t.x,l=i.x,o=e.y,u=t.y,h=i.y,p=Math.min(r,a,l),f=Math.min(o,u,h),m=Math.max(r,a,l),g=Math.max(o,u,h);let _=i.next;for(;_!==e;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&Lh(r,o,a,u,l,h,_.x,_.y)&&ni(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function iI(n,e,t,i){const r=n.prev,a=n,l=n.next;if(ni(r,a,l)>=0)return!1;const o=r.x,u=a.x,h=l.x,p=r.y,f=a.y,m=l.y,g=Math.min(o,u,h),_=Math.min(p,f,m),w=Math.max(o,u,h),v=Math.max(p,f,m),x=h0(g,_,e,t,i),S=h0(w,v,e,t,i);let b=n.prevZ,C=n.nextZ;for(;b&&b.z>=x&&C&&C.z<=S;){if(b.x>=g&&b.x<=w&&b.y>=_&&b.y<=v&&b!==r&&b!==l&&Lh(o,p,u,f,h,m,b.x,b.y)&&ni(b.prev,b,b.next)>=0||(b=b.prevZ,C.x>=g&&C.x<=w&&C.y>=_&&C.y<=v&&C!==r&&C!==l&&Lh(o,p,u,f,h,m,C.x,C.y)&&ni(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;b&&b.z>=x;){if(b.x>=g&&b.x<=w&&b.y>=_&&b.y<=v&&b!==r&&b!==l&&Lh(o,p,u,f,h,m,b.x,b.y)&&ni(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=S;){if(C.x>=g&&C.x<=w&&C.y>=_&&C.y<=v&&C!==r&&C!==l&&Lh(o,p,u,f,h,m,C.x,C.y)&&ni(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function rI(n,e){let t=n;do{const i=t.prev,r=t.next.next;!su(i,r)&&p2(i,t,t.next,r)&&Jh(i,r)&&Jh(r,i)&&(e.push(i.i,t.i,r.i),Qh(t),Qh(t.next),t=n=r),t=t.next}while(t!==n);return kl(t)}function sI(n,e,t,i,r,a){let l=n;do{let o=l.next.next;for(;o!==l.prev;){if(l.i!==o.i&&pI(l,o)){let u=m2(l,o);l=kl(l,l.next),u=kl(u,u.next),Zh(l,e,t,i,r,a,0),Zh(u,e,t,i,r,a,0);return}o=o.next}l=l.next}while(l!==n)}function aI(n,e,t,i){const r=[];for(let a=0,l=e.length;a<l;a++){const o=e[a]*i,u=a<l-1?e[a+1]*i:n.length,h=d2(n,o,u,i,!1);h===h.next&&(h.steiner=!0),r.push(fI(h))}r.sort(oI);for(let a=0;a<r.length;a++)t=lI(r[a],t);return t}function oI(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const i=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=i-r}return t}function lI(n,e){const t=cI(n,e);if(!t)return e;const i=m2(t,n);return kl(i,i.next),kl(t,t.next)}function cI(n,e){let t=e;const i=n.x,r=n.y;let a=-1/0,l;if(su(n,t))return t;do{if(su(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const f=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>a&&(a=f,l=t.x<t.next.x?t:t.next,f===i))return l}t=t.next}while(t!==e);if(!l)return null;const o=l,u=l.x,h=l.y;let p=1/0;t=l;do{if(i>=t.x&&t.x>=u&&i!==t.x&&f2(r<h?i:a,r,u,h,r<h?a:i,r,t.x,t.y)){const f=Math.abs(r-t.y)/(i-t.x);Jh(t,n)&&(f<p||f===p&&(t.x>l.x||t.x===l.x&&uI(l,t)))&&(l=t,p=f)}t=t.next}while(t!==o);return l}function uI(n,e){return ni(n.prev,n,e.prev)<0&&ni(e.next,n,n.next)<0}function hI(n,e,t,i){let r=n;do r.z===0&&(r.z=h0(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,dI(r)}function dI(n){let e,t=1;do{let i=n,r;n=null;let a=null;for(e=0;i;){e++;let l=i,o=0;for(let h=0;h<t&&(o++,l=l.nextZ,!!l);h++);let u=t;for(;o>0||u>0&&l;)o!==0&&(u===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,o--):(r=l,l=l.nextZ,u--),a?a.nextZ=r:n=r,r.prevZ=a,a=r;i=l}a.nextZ=null,t*=2}while(e>1);return n}function h0(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function fI(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function f2(n,e,t,i,r,a,l,o){return(r-l)*(e-o)>=(n-l)*(a-o)&&(n-l)*(i-o)>=(t-l)*(e-o)&&(t-l)*(a-o)>=(r-l)*(i-o)}function Lh(n,e,t,i,r,a,l,o){return!(n===l&&e===o)&&f2(n,e,t,i,r,a,l,o)}function pI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!mI(n,e)&&(Jh(n,e)&&Jh(e,n)&&gI(n,e)&&(ni(n.prev,n,e.prev)||ni(n,e.prev,e))||su(n,e)&&ni(n.prev,n,n.next)>0&&ni(e.prev,e,e.next)>0)}function ni(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function su(n,e){return n.x===e.x&&n.y===e.y}function p2(n,e,t,i){const r=op(ni(n,e,t)),a=op(ni(n,e,i)),l=op(ni(t,i,n)),o=op(ni(t,i,e));return!!(r!==a&&l!==o||r===0&&ap(n,t,e)||a===0&&ap(n,i,e)||l===0&&ap(t,n,i)||o===0&&ap(t,e,i))}function ap(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function op(n){return n>0?1:n<0?-1:0}function mI(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&p2(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Jh(n,e){return ni(n.prev,n,n.next)<0?ni(n,e,n.next)>=0&&ni(n,n.prev,e)>=0:ni(n,e,n.prev)<0||ni(n,n.next,e)<0}function gI(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&r<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function m2(n,e){const t=d0(n.i,n.x,n.y),i=d0(e.i,e.x,e.y),r=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function Ew(n,e,t,i){const r=d0(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Qh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function d0(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function yI(n,e,t,i){let r=0;for(let a=e,l=t-i;a<t;a+=i)r+=(n[l]-n[a])*(n[a+1]+n[l+1]),l=a;return r}class _I{static triangulate(e,t,i=2){return tI(e,t,i)}}class Xs{static area(e){const t=e.length;let i=0;for(let r=t-1,a=0;a<t;r=a++)i+=e[r].x*e[a].y-e[a].x*e[r].y;return i*.5}static isClockWise(e){return Xs.area(e)<0}static triangulateShape(e,t){const i=[],r=[],a=[];kw(e),Aw(i,e);let l=e.length;t.forEach(kw);for(let u=0;u<t.length;u++)r.push(l),l+=t[u].length,Aw(i,t[u]);const o=_I.triangulate(i,r);for(let u=0;u<o.length;u+=3)a.push(o.slice(u,u+3));return a}}function kw(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Aw(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class db extends an{constructor(e=new tu([new Qe(.5,.5),new Qe(-.5,.5),new Qe(-.5,-.5),new Qe(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],a=[];for(let o=0,u=e.length;o<u;o++){const h=e[o];l(h)}this.setAttribute("position",new xt(r,3)),this.setAttribute("uv",new xt(a,2)),this.computeVertexNormals();function l(o){const u=[],h=t.curveSegments!==void 0?t.curveSegments:12,p=t.steps!==void 0?t.steps:1,f=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,_=t.bevelSize!==void 0?t.bevelSize:g-.1,w=t.bevelOffset!==void 0?t.bevelOffset:0,v=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,S=t.UVGenerator!==void 0?t.UVGenerator:bI;let b,C=!1,O,M,D,N;if(x){b=x.getSpacedPoints(p),C=!0,m=!1;const Fe=x.isCatmullRomCurve3?x.closed:!1;O=x.computeFrenetFrames(p,Fe),M=new se,D=new se,N=new se}m||(v=0,g=0,_=0,w=0);const B=o.extractPoints(h);let U=B.shape;const Y=B.holes;if(!Xs.isClockWise(U)){U=U.reverse();for(let Fe=0,qe=Y.length;Fe<qe;Fe++){const ze=Y[Fe];Xs.isClockWise(ze)&&(Y[Fe]=ze.reverse())}}function H(Fe){const ze=10000000000000001e-36;let Ue=Fe[0];for(let at=1;at<=Fe.length;at++){const Lt=at%Fe.length,St=Fe[Lt],Tt=St.x-Ue.x,Re=St.y-Ue.y,He=Tt*Tt+Re*Re,st=Math.max(Math.abs(St.x),Math.abs(St.y),Math.abs(Ue.x),Math.abs(Ue.y)),kt=ze*st*st;if(He<=kt){Fe.splice(Lt,1),at--;continue}Ue=St}}H(U),Y.forEach(H);const J=Y.length,Q=U;for(let Fe=0;Fe<J;Fe++){const qe=Y[Fe];U=U.concat(qe)}function Z(Fe,qe,ze){return qe||wn("ExtrudeGeometry: vec does not exist"),Fe.clone().addScaledVector(qe,ze)}const ie=U.length;function ne(Fe,qe,ze){let Ue,at,Lt;const St=Fe.x-qe.x,Tt=Fe.y-qe.y,Re=ze.x-Fe.x,He=ze.y-Fe.y,st=St*St+Tt*Tt,kt=St*He-Tt*Re;if(Math.abs(kt)>Number.EPSILON){const _e=Math.sqrt(st),Ve=Math.sqrt(Re*Re+He*He),ft=qe.x-Tt/_e,Et=qe.y+St/_e,Pt=ze.x-He/Ve,Tn=ze.y+Re/Ve,Ht=((Pt-ft)*He-(Tn-Et)*Re)/(St*He-Tt*Re);Ue=ft+St*Ht-Fe.x,at=Et+Tt*Ht-Fe.y;const Pn=Ue*Ue+at*at;if(Pn<=2)return new Qe(Ue,at);Lt=Math.sqrt(Pn/2)}else{let _e=!1;St>Number.EPSILON?Re>Number.EPSILON&&(_e=!0):St<-Number.EPSILON?Re<-Number.EPSILON&&(_e=!0):Math.sign(Tt)===Math.sign(He)&&(_e=!0),_e?(Ue=-Tt,at=St,Lt=Math.sqrt(st)):(Ue=St,at=Tt,Lt=Math.sqrt(st/2))}return new Qe(Ue/Lt,at/Lt)}const P=[];for(let Fe=0,qe=Q.length,ze=qe-1,Ue=Fe+1;Fe<qe;Fe++,ze++,Ue++)ze===qe&&(ze=0),Ue===qe&&(Ue=0),P[Fe]=ne(Q[Fe],Q[ze],Q[Ue]);const L=[];let F,$=P.concat();for(let Fe=0,qe=J;Fe<qe;Fe++){const ze=Y[Fe];F=[];for(let Ue=0,at=ze.length,Lt=at-1,St=Ue+1;Ue<at;Ue++,Lt++,St++)Lt===at&&(Lt=0),St===at&&(St=0),F[Ue]=ne(ze[Ue],ze[Lt],ze[St]);L.push(F),$=$.concat(F)}let W;if(v===0)W=Xs.triangulateShape(Q,Y);else{const Fe=[],qe=[];for(let ze=0;ze<v;ze++){const Ue=ze/v,at=g*Math.cos(Ue*Math.PI/2),Lt=_*Math.sin(Ue*Math.PI/2)+w;for(let St=0,Tt=Q.length;St<Tt;St++){const Re=Z(Q[St],P[St],Lt);Ce(Re.x,Re.y,-at),Ue===0&&Fe.push(Re)}for(let St=0,Tt=J;St<Tt;St++){const Re=Y[St];F=L[St];const He=[];for(let st=0,kt=Re.length;st<kt;st++){const _e=Z(Re[st],F[st],Lt);Ce(_e.x,_e.y,-at),Ue===0&&He.push(_e)}Ue===0&&qe.push(He)}}W=Xs.triangulateShape(Fe,qe)}const ye=W.length,be=_+w;for(let Fe=0;Fe<ie;Fe++){const qe=m?Z(U[Fe],$[Fe],be):U[Fe];C?(D.copy(O.normals[0]).multiplyScalar(qe.x),M.copy(O.binormals[0]).multiplyScalar(qe.y),N.copy(b[0]).add(D).add(M),Ce(N.x,N.y,N.z)):Ce(qe.x,qe.y,0)}for(let Fe=1;Fe<=p;Fe++)for(let qe=0;qe<ie;qe++){const ze=m?Z(U[qe],$[qe],be):U[qe];C?(D.copy(O.normals[Fe]).multiplyScalar(ze.x),M.copy(O.binormals[Fe]).multiplyScalar(ze.y),N.copy(b[Fe]).add(D).add(M),Ce(N.x,N.y,N.z)):Ce(ze.x,ze.y,f/p*Fe)}for(let Fe=v-1;Fe>=0;Fe--){const qe=Fe/v,ze=g*Math.cos(qe*Math.PI/2),Ue=_*Math.sin(qe*Math.PI/2)+w;for(let at=0,Lt=Q.length;at<Lt;at++){const St=Z(Q[at],P[at],Ue);Ce(St.x,St.y,f+ze)}for(let at=0,Lt=Y.length;at<Lt;at++){const St=Y[at];F=L[at];for(let Tt=0,Re=St.length;Tt<Re;Tt++){const He=Z(St[Tt],F[Tt],Ue);C?Ce(He.x,He.y+b[p-1].y,b[p-1].x+ze):Ce(He.x,He.y,f+ze)}}}Ne(),le();function Ne(){const Fe=r.length/3;if(m){let qe=0,ze=ie*qe;for(let Ue=0;Ue<ye;Ue++){const at=W[Ue];xe(at[2]+ze,at[1]+ze,at[0]+ze)}qe=p+v*2,ze=ie*qe;for(let Ue=0;Ue<ye;Ue++){const at=W[Ue];xe(at[0]+ze,at[1]+ze,at[2]+ze)}}else{for(let qe=0;qe<ye;qe++){const ze=W[qe];xe(ze[2],ze[1],ze[0])}for(let qe=0;qe<ye;qe++){const ze=W[qe];xe(ze[0]+ie*p,ze[1]+ie*p,ze[2]+ie*p)}}i.addGroup(Fe,r.length/3-Fe,0)}function le(){const Fe=r.length/3;let qe=0;ee(Q,qe),qe+=Q.length;for(let ze=0,Ue=Y.length;ze<Ue;ze++){const at=Y[ze];ee(at,qe),qe+=at.length}i.addGroup(Fe,r.length/3-Fe,1)}function ee(Fe,qe){let ze=Fe.length;for(;--ze>=0;){const Ue=ze;let at=ze-1;at<0&&(at=Fe.length-1);for(let Lt=0,St=p+v*2;Lt<St;Lt++){const Tt=ie*Lt,Re=ie*(Lt+1),He=qe+Ue+Tt,st=qe+at+Tt,kt=qe+at+Re,_e=qe+Ue+Re;Ze(He,st,kt,_e)}}}function Ce(Fe,qe,ze){u.push(Fe),u.push(qe),u.push(ze)}function xe(Fe,qe,ze){De(Fe),De(qe),De(ze);const Ue=r.length/3,at=S.generateTopUV(i,r,Ue-3,Ue-2,Ue-1);wt(at[0]),wt(at[1]),wt(at[2])}function Ze(Fe,qe,ze,Ue){De(Fe),De(qe),De(Ue),De(qe),De(ze),De(Ue);const at=r.length/3,Lt=S.generateSideWallUV(i,r,at-6,at-3,at-2,at-1);wt(Lt[0]),wt(Lt[1]),wt(Lt[3]),wt(Lt[1]),wt(Lt[2]),wt(Lt[3])}function De(Fe){r.push(u[Fe*3+0]),r.push(u[Fe*3+1]),r.push(u[Fe*3+2])}function wt(Fe){a.push(Fe.x),a.push(Fe.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return vI(t,i,e)}static fromJSON(e,t){const i=[];for(let a=0,l=e.shapes.length;a<l;a++){const o=t[e.shapes[a]];i.push(o)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Vp[r.type]().fromJSON(r)),new db(i,e.options)}}const bI={generateTopUV:function(n,e,t,i,r){const a=e[t*3],l=e[t*3+1],o=e[i*3],u=e[i*3+1],h=e[r*3],p=e[r*3+1];return[new Qe(a,l),new Qe(o,u),new Qe(h,p)]},generateSideWallUV:function(n,e,t,i,r,a){const l=e[t*3],o=e[t*3+1],u=e[t*3+2],h=e[i*3],p=e[i*3+1],f=e[i*3+2],m=e[r*3],g=e[r*3+1],_=e[r*3+2],w=e[a*3],v=e[a*3+1],x=e[a*3+2];return Math.abs(o-p)<Math.abs(l-h)?[new Qe(l,1-u),new Qe(h,1-f),new Qe(m,1-_),new Qe(w,1-x)]:[new Qe(o,1-u),new Qe(p,1-f),new Qe(g,1-_),new Qe(v,1-x)]}};function vI(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const a=n[i];t.shapes.push(a.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class fb extends Ml{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,a,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new fb(e.radius,e.detail)}}class pb extends an{constructor(e=[new Qe(0,-.5),new Qe(.5,0),new Qe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=jt(r,0,Math.PI*2);const a=[],l=[],o=[],u=[],h=[],p=1/t,f=new se,m=new Qe,g=new se,_=new se,w=new se;let v=0,x=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:v=e[S+1].x-e[S].x,x=e[S+1].y-e[S].y,g.x=x*1,g.y=-v,g.z=x*0,w.copy(g),g.normalize(),u.push(g.x,g.y,g.z);break;case e.length-1:u.push(w.x,w.y,w.z);break;default:v=e[S+1].x-e[S].x,x=e[S+1].y-e[S].y,g.x=x*1,g.y=-v,g.z=x*0,_.copy(g),g.x+=w.x,g.y+=w.y,g.z+=w.z,g.normalize(),u.push(g.x,g.y,g.z),w.copy(_)}for(let S=0;S<=t;S++){const b=i+S*p*r,C=Math.sin(b),O=Math.cos(b);for(let M=0;M<=e.length-1;M++){f.x=e[M].x*C,f.y=e[M].y,f.z=e[M].x*O,l.push(f.x,f.y,f.z),m.x=S/t,m.y=M/(e.length-1),o.push(m.x,m.y);const D=u[3*M+0]*C,N=u[3*M+1],B=u[3*M+0]*O;h.push(D,N,B)}}for(let S=0;S<t;S++)for(let b=0;b<e.length-1;b++){const C=b+S*e.length,O=C,M=C+e.length,D=C+e.length+1,N=C+1;a.push(O,M,N),a.push(D,N,M)}this.setIndex(a),this.setAttribute("position",new xt(l,3)),this.setAttribute("uv",new xt(o,2)),this.setAttribute("normal",new xt(h,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pb(e.points,e.segments,e.phiStart,e.phiLength)}}class _m extends Ml{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _m(e.radius,e.detail)}}class mb extends an{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const a=e/2,l=t/2,o=Math.floor(i),u=Math.floor(r),h=o+1,p=u+1,f=e/o,m=t/u,g=[],_=[],w=[],v=[];for(let x=0;x<p;x++){const S=x*m-l;for(let b=0;b<h;b++){const C=b*f-a;_.push(C,-S,0),w.push(0,0,1),v.push(b/o),v.push(1-x/u)}}for(let x=0;x<u;x++)for(let S=0;S<o;S++){const b=S+h*x,C=S+h*(x+1),O=S+1+h*(x+1),M=S+1+h*x;g.push(b,C,M),g.push(C,O,M)}this.setIndex(g),this.setAttribute("position",new xt(_,3)),this.setAttribute("normal",new xt(w,3)),this.setAttribute("uv",new xt(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mb(e.width,e.height,e.widthSegments,e.heightSegments)}}class gb extends an{constructor(e=.5,t=1,i=32,r=1,a=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:l},i=Math.max(3,i),r=Math.max(1,r);const o=[],u=[],h=[],p=[];let f=e;const m=(t-e)/r,g=new se,_=new Qe;for(let w=0;w<=r;w++){for(let v=0;v<=i;v++){const x=a+v/i*l;g.x=f*Math.cos(x),g.y=f*Math.sin(x),u.push(g.x,g.y,g.z),h.push(0,0,1),_.x=(g.x/t+1)/2,_.y=(g.y/t+1)/2,p.push(_.x,_.y)}f+=m}for(let w=0;w<r;w++){const v=w*(i+1);for(let x=0;x<i;x++){const S=x+v,b=S,C=S+i+1,O=S+i+2,M=S+1;o.push(b,C,M),o.push(C,O,M)}}this.setIndex(o),this.setAttribute("position",new xt(u,3)),this.setAttribute("normal",new xt(h,3)),this.setAttribute("uv",new xt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new gb(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class yb extends an{constructor(e=new tu([new Qe(0,.5),new Qe(-.5,-.5),new Qe(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],a=[],l=[];let o=0,u=0;if(Array.isArray(e)===!1)h(e);else for(let p=0;p<e.length;p++)h(e[p]),this.addGroup(o,u,p),o+=u,u=0;this.setIndex(i),this.setAttribute("position",new xt(r,3)),this.setAttribute("normal",new xt(a,3)),this.setAttribute("uv",new xt(l,2));function h(p){const f=r.length/3,m=p.extractPoints(t);let g=m.shape;const _=m.holes;Xs.isClockWise(g)===!1&&(g=g.reverse());for(let v=0,x=_.length;v<x;v++){const S=_[v];Xs.isClockWise(S)===!0&&(_[v]=S.reverse())}const w=Xs.triangulateShape(g,_);for(let v=0,x=_.length;v<x;v++){const S=_[v];g=g.concat(S)}for(let v=0,x=g.length;v<x;v++){const S=g[v];r.push(S.x,S.y,0),a.push(0,0,1),l.push(S.x,S.y)}for(let v=0,x=w.length;v<x;v++){const S=w[v],b=S[0]+f,C=S[1]+f,O=S[2]+f;i.push(b,C,O),u+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return xI(t,e)}static fromJSON(e,t){const i=[];for(let r=0,a=e.shapes.length;r<a;r++){const l=t[e.shapes[r]];i.push(l)}return new yb(i,e.curveSegments)}}function xI(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class xs extends an{constructor(e=1,t=32,i=16,r=0,a=Math.PI*2,l=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:a,thetaStart:l,thetaLength:o},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(l+o,Math.PI);let h=0;const p=[],f=new se,m=new se,g=[],_=[],w=[],v=[];for(let x=0;x<=i;x++){const S=[],b=x/i;let C=0;x===0&&l===0?C=.5/t:x===i&&u===Math.PI&&(C=-.5/t);for(let O=0;O<=t;O++){const M=O/t;f.x=-e*Math.cos(r+M*a)*Math.sin(l+b*o),f.y=e*Math.cos(l+b*o),f.z=e*Math.sin(r+M*a)*Math.sin(l+b*o),_.push(f.x,f.y,f.z),m.copy(f).normalize(),w.push(m.x,m.y,m.z),v.push(M+C,1-b),S.push(h++)}p.push(S)}for(let x=0;x<i;x++)for(let S=0;S<t;S++){const b=p[x][S+1],C=p[x][S],O=p[x+1][S],M=p[x+1][S+1];(x!==0||l>0)&&g.push(b,C,M),(x!==i-1||u<Math.PI)&&g.push(C,O,M)}this.setIndex(g),this.setAttribute("position",new xt(_,3)),this.setAttribute("normal",new xt(w,3)),this.setAttribute("uv",new xt(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class _b extends Ml{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _b(e.radius,e.detail)}}class bb extends an{constructor(e=1,t=.4,i=12,r=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:a},i=Math.floor(i),r=Math.floor(r);const l=[],o=[],u=[],h=[],p=new se,f=new se,m=new se;for(let g=0;g<=i;g++)for(let _=0;_<=r;_++){const w=_/r*a,v=g/i*Math.PI*2;f.x=(e+t*Math.cos(v))*Math.cos(w),f.y=(e+t*Math.cos(v))*Math.sin(w),f.z=t*Math.sin(v),o.push(f.x,f.y,f.z),p.x=e*Math.cos(w),p.y=e*Math.sin(w),m.subVectors(f,p).normalize(),u.push(m.x,m.y,m.z),h.push(_/r),h.push(g/i)}for(let g=1;g<=i;g++)for(let _=1;_<=r;_++){const w=(r+1)*g+_-1,v=(r+1)*(g-1)+_-1,x=(r+1)*(g-1)+_,S=(r+1)*g+_;l.push(w,v,S),l.push(v,x,S)}this.setIndex(l),this.setAttribute("position",new xt(o,3)),this.setAttribute("normal",new xt(u,3)),this.setAttribute("uv",new xt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bb(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class vb extends an{constructor(e=1,t=.4,i=64,r=8,a=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:a,q:l},i=Math.floor(i),r=Math.floor(r);const o=[],u=[],h=[],p=[],f=new se,m=new se,g=new se,_=new se,w=new se,v=new se,x=new se;for(let b=0;b<=i;++b){const C=b/i*a*Math.PI*2;S(C,a,l,e,g),S(C+.01,a,l,e,_),v.subVectors(_,g),x.addVectors(_,g),w.crossVectors(v,x),x.crossVectors(w,v),w.normalize(),x.normalize();for(let O=0;O<=r;++O){const M=O/r*Math.PI*2,D=-t*Math.cos(M),N=t*Math.sin(M);f.x=g.x+(D*x.x+N*w.x),f.y=g.y+(D*x.y+N*w.y),f.z=g.z+(D*x.z+N*w.z),u.push(f.x,f.y,f.z),m.subVectors(f,g).normalize(),h.push(m.x,m.y,m.z),p.push(b/i),p.push(O/r)}}for(let b=1;b<=i;b++)for(let C=1;C<=r;C++){const O=(r+1)*(b-1)+(C-1),M=(r+1)*b+(C-1),D=(r+1)*b+C,N=(r+1)*(b-1)+C;o.push(O,M,N),o.push(M,D,N)}this.setIndex(o),this.setAttribute("position",new xt(u,3)),this.setAttribute("normal",new xt(h,3)),this.setAttribute("uv",new xt(p,2));function S(b,C,O,M,D){const N=Math.cos(b),B=Math.sin(b),U=O/C*b,Y=Math.cos(U);D.x=M*(2+Y)*.5*N,D.y=M*(2+Y)*B*.5,D.z=M*Math.sin(U)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vb(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class xb extends an{constructor(e=new u2(new se(-1,-1,0),new se(-1,1,0),new se(1,1,0)),t=64,i=1,r=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:a};const l=e.computeFrenetFrames(t,a);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const o=new se,u=new se,h=new Qe;let p=new se;const f=[],m=[],g=[],_=[];w(),this.setIndex(_),this.setAttribute("position",new xt(f,3)),this.setAttribute("normal",new xt(m,3)),this.setAttribute("uv",new xt(g,2));function w(){for(let b=0;b<t;b++)v(b);v(a===!1?t:0),S(),x()}function v(b){p=e.getPointAt(b/t,p);const C=l.normals[b],O=l.binormals[b];for(let M=0;M<=r;M++){const D=M/r*Math.PI*2,N=Math.sin(D),B=-Math.cos(D);u.x=B*C.x+N*O.x,u.y=B*C.y+N*O.y,u.z=B*C.z+N*O.z,u.normalize(),m.push(u.x,u.y,u.z),o.x=p.x+i*u.x,o.y=p.y+i*u.y,o.z=p.z+i*u.z,f.push(o.x,o.y,o.z)}}function x(){for(let b=1;b<=t;b++)for(let C=1;C<=r;C++){const O=(r+1)*(b-1)+(C-1),M=(r+1)*b+(C-1),D=(r+1)*b+C,N=(r+1)*(b-1)+C;_.push(O,M,N),_.push(M,D,N)}}function S(){for(let b=0;b<=t;b++)for(let C=0;C<=r;C++)h.x=b/t,h.y=C/r,g.push(h.x,h.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new xb(new Vp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class SI extends an{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new se,a=new se;if(e.index!==null){const l=e.attributes.position,o=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:o.count,materialIndex:0}]);for(let h=0,p=u.length;h<p;++h){const f=u[h],m=f.start,g=f.count;for(let _=m,w=m+g;_<w;_+=3)for(let v=0;v<3;v++){const x=o.getX(_+v),S=o.getX(_+(v+1)%3);r.fromBufferAttribute(l,x),a.fromBufferAttribute(l,S),Tw(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}}else{const l=e.attributes.position;for(let o=0,u=l.count/3;o<u;o++)for(let h=0;h<3;h++){const p=3*o+h,f=3*o+(h+1)%3;r.fromBufferAttribute(l,p),a.fromBufferAttribute(l,f),Tw(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new xt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Tw(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var Mw=Object.freeze({__proto__:null,BoxGeometry:Kn,CapsuleGeometry:ob,CircleGeometry:lb,ConeGeometry:ym,CylinderGeometry:od,DodecahedronGeometry:cb,EdgesGeometry:Ih,ExtrudeGeometry:db,IcosahedronGeometry:fb,LatheGeometry:pb,OctahedronGeometry:_m,PlaneGeometry:mb,PolyhedronGeometry:Ml,RingGeometry:gb,ShapeGeometry:yb,SphereGeometry:xs,TetrahedronGeometry:_b,TorusGeometry:bb,TorusKnotGeometry:vb,TubeGeometry:xb,WireframeGeometry:SI});class wI extends lr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Vt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class CI extends Z0{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ld extends lr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Vt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Js,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class EI extends ld{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Qe(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return jt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Vt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Vt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Vt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class kI extends lr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Vt(16777215),this.specular=new Vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Js,this.combine=W0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class AI extends lr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class TI extends lr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class MI extends lr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Js,this.combine=W0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RI extends lr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=RN,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class OI extends lr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class NI extends lr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hu,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DI extends cr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function wl(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function g2(n){function e(r,a){return n[r]-n[a]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function f0(n,e,t){const i=n.length,r=new n.constructor(i);for(let a=0,l=0;l!==i;++a){const o=t[a]*e;for(let u=0;u!==e;++u)r[l++]=n[o+u]}return r}function Sb(n,e,t,i){let r=1,a=n[0];for(;a!==void 0&&a[i]===void 0;)a=n[r++];if(a===void 0)return;let l=a[i];if(l!==void 0)if(Array.isArray(l))do l=a[i],l!==void 0&&(e.push(a.time),t.push(...l)),a=n[r++];while(a!==void 0);else if(l.toArray!==void 0)do l=a[i],l!==void 0&&(e.push(a.time),l.toArray(t,t.length)),a=n[r++];while(a!==void 0);else do l=a[i],l!==void 0&&(e.push(a.time),t.push(l)),a=n[r++];while(a!==void 0)}function II(n,e,t,i,r=30){const a=n.clone();a.name=e;const l=[];for(let u=0;u<a.tracks.length;++u){const h=a.tracks[u],p=h.getValueSize(),f=[],m=[];for(let g=0;g<h.times.length;++g){const _=h.times[g]*r;if(!(_<t||_>=i)){f.push(h.times[g]);for(let w=0;w<p;++w)m.push(h.values[g*p+w])}}f.length!==0&&(h.times=wl(f,h.times.constructor),h.values=wl(m,h.values.constructor),l.push(h))}a.tracks=l;let o=1/0;for(let u=0;u<a.tracks.length;++u)o>a.tracks[u].times[0]&&(o=a.tracks[u].times[0]);for(let u=0;u<a.tracks.length;++u)a.tracks[u].shift(-1*o);return a.resetDuration(),a}function LI(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,a=e/i;for(let l=0;l<r;++l){const o=t.tracks[l],u=o.ValueTypeName;if(u==="bool"||u==="string")continue;const h=n.tracks.find(function(x){return x.name===o.name&&x.ValueTypeName===u});if(h===void 0)continue;let p=0;const f=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=f/3);let m=0;const g=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=g/3);const _=o.times.length-1;let w;if(a<=o.times[0]){const x=p,S=f-p;w=o.values.slice(x,S)}else if(a>=o.times[_]){const x=_*f+p,S=x+f-p;w=o.values.slice(x,S)}else{const x=o.createInterpolant(),S=p,b=f-p;x.evaluate(a),w=x.resultBuffer.slice(S,b)}u==="quaternion"&&new Ir().fromArray(w).normalize().conjugate().toArray(w);const v=h.times.length;for(let x=0;x<v;++x){const S=x*g+m;if(u==="quaternion")Ir.multiplyQuaternionsFlat(h.values,S,w,0,h.values,S);else{const b=g-m*2;for(let C=0;C<b;++C)h.values[S+C]-=w[C]}}}return n.blendMode=XE,n}class eY{static convertArray(e,t){return wl(e,t)}static isTypedArray(e){return JE(e)}static getKeyframeOrder(e){return g2(e)}static sortedArray(e,t,i){return f0(e,t,i)}static flattenJSON(e,t,i,r){Sb(e,t,i,r)}static subclip(e,t,i,r,a=30){return II(e,t,i,r,a)}static makeClipAdditive(e,t=0,i=e,r=30){return LI(e,t,i,r)}}class bm{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],a=t[i-1];e:{t:{let l;n:{i:if(!(e<r)){for(let o=i+2;;){if(r===void 0){if(e<a)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(a=r,r=t[++i],e<r)break t}l=t.length;break n}if(!(e>=a)){const o=t[1];e<o&&(i=2,a=o);for(let u=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===u)break;if(r=a,a=t[--i-1],e>=a)break t}l=i,i=0;break n}break e}for(;i<l;){const o=i+l>>>1;e<t[o]?l=o:i=o+1}if(r=t[i],a=t[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,a,r)}return this.interpolate_(i,a,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r;for(let l=0;l!==r;++l)t[l]=i[a+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class BI extends bm{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zc,endingEnd:Zc}}intervalChanged_(e,t,i){const r=this.parameterPositions;let a=e-2,l=e+1,o=r[a],u=r[l];if(o===void 0)switch(this.getSettings_().endingStart){case Jc:a=e,o=2*t-i;break;case Fp:a=r.length-2,o=t+r[a]-r[a+1];break;default:a=e,o=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Jc:l=e,u=2*i-t;break;case Fp:l=1,u=i+r[1]-r[0];break;default:l=e-1,u=t}const h=(i-t)*.5,p=this.valueSize;this._weightPrev=h/(t-o),this._weightNext=h/(u-i),this._offsetPrev=a*p,this._offsetNext=l*p}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=e*o,h=u-o,p=this._offsetPrev,f=this._offsetNext,m=this._weightPrev,g=this._weightNext,_=(i-t)/(r-t),w=_*_,v=w*_,x=-m*v+2*m*w-m*_,S=(1+m)*v+(-1.5-2*m)*w+(-.5+m)*_+1,b=(-1-g)*v+(1.5+g)*w+.5*_,C=g*v-g*w;for(let O=0;O!==o;++O)a[O]=x*l[p+O]+S*l[h+O]+b*l[u+O]+C*l[f+O];return a}}class y2 extends bm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=e*o,h=u-o,p=(i-t)/(r-t),f=1-p;for(let m=0;m!==o;++m)a[m]=l[h+m]*f+l[u+m]*p;return a}}class zI extends bm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Es{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=wl(t,this.TimeBufferType),this.values=wl(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:wl(e.times,Array),values:wl(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new zI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new y2(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new BI(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pp:t=this.InterpolantFactoryMethodDiscrete;break;case l0:t=this.InterpolantFactoryMethodLinear;break;case Ny:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return zt("KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pp;case this.InterpolantFactoryMethodLinear:return l0;case this.InterpolantFactoryMethodSmooth:return Ny}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let a=0,l=r-1;for(;a!==r&&i[a]<e;)++a;for(;l!==-1&&i[l]>t;)--l;if(++l,a!==0||l!==r){a>=l&&(l=Math.max(l,1),a=l-1);const o=this.getValueSize();this.times=i.slice(a,l),this.values=this.values.slice(a*o,l*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(wn("KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,a=i.length;a===0&&(wn("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let o=0;o!==a;o++){const u=i[o];if(typeof u=="number"&&isNaN(u)){wn("KeyframeTrack: Time is not a valid number.",this,o,u),e=!1;break}if(l!==null&&l>u){wn("KeyframeTrack: Out of order keys.",this,o,u,l),e=!1;break}l=u}if(r!==void 0&&JE(r))for(let o=0,u=r.length;o!==u;++o){const h=r[o];if(isNaN(h)){wn("KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Ny,a=e.length-1;let l=1;for(let o=1;o<a;++o){let u=!1;const h=e[o],p=e[o+1];if(h!==p&&(o!==1||h!==e[0]))if(r)u=!0;else{const f=o*i,m=f-i,g=f+i;for(let _=0;_!==i;++_){const w=t[f+_];if(w!==t[m+_]||w!==t[g+_]){u=!0;break}}}if(u){if(o!==l){e[l]=e[o];const f=o*i,m=l*i;for(let g=0;g!==i;++g)t[m+g]=t[f+g]}++l}}if(a>0){e[l]=e[a];for(let o=a*i,u=l*i,h=0;h!==i;++h)t[u+h]=t[o+h];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Es.prototype.ValueTypeName="";Es.prototype.TimeBufferType=Float32Array;Es.prototype.ValueBufferType=Float32Array;Es.prototype.DefaultInterpolation=l0;class fu extends Es{constructor(e,t,i){super(e,t,i)}}fu.prototype.ValueTypeName="bool";fu.prototype.ValueBufferType=Array;fu.prototype.DefaultInterpolation=Pp;fu.prototype.InterpolantFactoryMethodLinear=void 0;fu.prototype.InterpolantFactoryMethodSmooth=void 0;class _2 extends Es{constructor(e,t,i,r){super(e,t,i,r)}}_2.prototype.ValueTypeName="color";class Wp extends Es{constructor(e,t,i,r){super(e,t,i,r)}}Wp.prototype.ValueTypeName="number";class PI extends bm{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const a=this.resultBuffer,l=this.sampleValues,o=this.valueSize,u=(i-t)/(r-t);let h=e*o;for(let p=h+o;h!==p;h+=4)Ir.slerpFlat(a,0,l,h-o,l,h,u);return a}}class vm extends Es{constructor(e,t,i,r){super(e,t,i,r)}InterpolantFactoryMethodLinear(e){return new PI(this.times,this.values,this.getValueSize(),e)}}vm.prototype.ValueTypeName="quaternion";vm.prototype.InterpolantFactoryMethodSmooth=void 0;class pu extends Es{constructor(e,t,i){super(e,t,i)}}pu.prototype.ValueTypeName="string";pu.prototype.ValueBufferType=Array;pu.prototype.DefaultInterpolation=Pp;pu.prototype.InterpolantFactoryMethodLinear=void 0;pu.prototype.InterpolantFactoryMethodSmooth=void 0;class $p extends Es{constructor(e,t,i,r){super(e,t,i,r)}}$p.prototype.ValueTypeName="vector";class Gp{constructor(e="",t=-1,i=[],r=K0){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Dr(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let l=0,o=i.length;l!==o;++l)t.push(jI(i[l]).scale(r));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a.userData=JSON.parse(e.userData||"{}"),a}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let a=0,l=i.length;a!==l;++a)t.push(Es.toJSON(i[a]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const a=t.length,l=[];for(let o=0;o<a;o++){let u=[],h=[];u.push((o+a-1)%a,o,(o+1)%a),h.push(0,1,0);const p=g2(u);u=f0(u,1,p),h=f0(h,1,p),!r&&u[0]===0&&(u.push(a),h.push(h[0])),l.push(new Wp(".morphTargetInfluences["+t[o].name+"]",u,h).scale(1/i))}return new this(e,-1,l)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,u=e.length;o<u;o++){const h=e[o],p=h.name.match(a);if(p&&p.length>1){const f=p[1];let m=r[f];m||(r[f]=m=[]),m.push(h)}}const l=[];for(const o in r)l.push(this.CreateFromMorphTargetSequence(o,r[o],t,i));return l}static parseAnimation(e,t){if(zt("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return wn("AnimationClip: No animation in JSONLoader data."),null;const i=function(f,m,g,_,w){if(g.length!==0){const v=[],x=[];Sb(g,v,x,_),v.length!==0&&w.push(new f(m,v,x))}},r=[],a=e.name||"default",l=e.fps||30,o=e.blendMode;let u=e.length||-1;const h=e.hierarchy||[];for(let f=0;f<h.length;f++){const m=h[f].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const g={};let _;for(_=0;_<m.length;_++)if(m[_].morphTargets)for(let w=0;w<m[_].morphTargets.length;w++)g[m[_].morphTargets[w]]=-1;for(const w in g){const v=[],x=[];for(let S=0;S!==m[_].morphTargets.length;++S){const b=m[_];v.push(b.time),x.push(b.morphTarget===w?1:0)}r.push(new Wp(".morphTargetInfluence["+w+"]",v,x))}u=g.length*l}else{const g=".bones["+t[f].name+"]";i($p,g+".position",m,"pos",r),i(vm,g+".quaternion",m,"rot",r),i($p,g+".scale",m,"scl",r)}}return r.length===0?null:new this(a,u,r,o)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const a=this.tracks[i];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let i=0;i<this.tracks.length;i++)e.push(this.tracks[i].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function FI(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wp;case"vector":case"vector2":case"vector3":case"vector4":return $p;case"color":return _2;case"quaternion":return vm;case"bool":case"boolean":return fu;case"string":return pu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function jI(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=FI(n.type);if(n.times===void 0){const t=[],i=[];Sb(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const za={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class b2{constructor(e,t,i){const r=this;let a=!1,l=0,o=0,u;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(p){o++,a===!1&&r.onStart!==void 0&&r.onStart(p,l,o),a=!0},this.itemEnd=function(p){l++,r.onProgress!==void 0&&r.onProgress(p,l,o),l===o&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(p){r.onError!==void 0&&r.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,f){return h.push(p,f),this},this.removeHandler=function(p){const f=h.indexOf(p);return f!==-1&&h.splice(f,2),this},this.getHandler=function(p){for(let f=0,m=h.length;f<m;f+=2){const g=h[f],_=h[f+1];if(g.global&&(g.lastIndex=0),g.test(p))return _}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const UI=new b2;class Pr{constructor(e){this.manager=e!==void 0?e:UI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,a){i.load(e,r,t,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Pr.DEFAULT_MATERIAL_NAME="__DEFAULT";const Da={};class HI extends Error{constructor(e,t){super(e),this.response=t}}class zo extends Pr{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=za.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(Da[e]!==void 0){Da[e].push({onLoad:t,onProgress:i,onError:r});return}Da[e]=[],Da[e].push({onLoad:t,onProgress:i,onError:r});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,u=this.responseType;fetch(l).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&zt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const p=Da[e],f=h.body.getReader(),m=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),g=m?parseInt(m):0,_=g!==0;let w=0;const v=new ReadableStream({start(x){S();function S(){f.read().then(({done:b,value:C})=>{if(b)x.close();else{w+=C.byteLength;const O=new ProgressEvent("progress",{lengthComputable:_,loaded:w,total:g});for(let M=0,D=p.length;M<D;M++){const N=p[M];N.onProgress&&N.onProgress(O)}x.enqueue(C),S()}},b=>{x.error(b)})}}});return new Response(v)}else throw new HI(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(u){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(p=>new DOMParser().parseFromString(p,o));case"json":return h.json();default:if(o==="")return h.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),m=f&&f[1]?f[1].toLowerCase():void 0,g=new TextDecoder(m);return h.arrayBuffer().then(_=>g.decode(_))}}}).then(h=>{za.add(`file:${e}`,h);const p=Da[e];delete Da[e];for(let f=0,m=p.length;f<m;f++){const g=p[f];g.onLoad&&g.onLoad(h)}}).catch(h=>{const p=Da[e];if(p===void 0)throw this.manager.itemError(e),h;delete Da[e];for(let f=0,m=p.length;f<m;f++){const g=p[f];g.onError&&g.onError(h)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class tY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):wn(u),a.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=Gp.parse(e[i]);t.push(r)}return t}}class nY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=[],o=new ab,u=new zo(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(a.withCredentials);let h=0;function p(f){u.load(e[f],function(m){const g=a.parse(m,!0);l[f]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},h+=1,h===6&&(g.mipmapCount===1&&(o.minFilter=ts),o.image=l,o.format=g.format,o.needsUpdate=!0,t&&t(o))},i,r)}if(Array.isArray(e))for(let f=0,m=e.length;f<m;++f)p(f);else u.load(e,function(f){const m=a.parse(f,!0);if(m.isCubemap){const g=m.mipmaps.length/m.mipmapCount;for(let _=0;_<g;_++){l[_]={mipmaps:[]};for(let w=0;w<m.mipmapCount;w++)l[_].mipmaps.push(m.mipmaps[_*m.mipmapCount+w]),l[_].format=m.format,l[_].width=m.width,l[_].height=m.height}o.image=l}else o.image.width=m.width,o.image.height=m.height,o.mipmaps=m.mipmaps;m.mipmapCount===1&&(o.minFilter=ts),o.format=m.format,o.needsUpdate=!0,t&&t(o)},i,r);return o}}const Hc=new WeakMap;class Kp extends Pr{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=za.get(`image:${e}`);if(l!==void 0){if(l.complete===!0)a.manager.itemStart(e),setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0);else{let f=Hc.get(l);f===void 0&&(f=[],Hc.set(l,f)),f.push({onLoad:t,onError:r})}return l}const o=Up("img");function u(){p(),t&&t(this);const f=Hc.get(this)||[];for(let m=0;m<f.length;m++){const g=f[m];g.onLoad&&g.onLoad(this)}Hc.delete(this),a.manager.itemEnd(e)}function h(f){p(),r&&r(f),za.remove(`image:${e}`);const m=Hc.get(this)||[];for(let g=0;g<m.length;g++){const _=m[g];_.onError&&_.onError(f)}Hc.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function p(){o.removeEventListener("load",u,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",u,!1),o.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),za.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class iY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=new Q0;a.colorSpace=Jr;const l=new Kp(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let o=0;function u(h){l.load(e[h],function(p){a.images[h]=p,o++,o===6&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}for(let h=0;h<e.length;++h)u(h);return a}}class rY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new Fa,o=new zo(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(a.withCredentials),o.load(e,function(u){let h;try{h=a.parse(u)}catch(p){if(r!==void 0)r(p);else{p(p);return}}h.image!==void 0?l.image=h.image:h.data!==void 0&&(l.image.width=h.width,l.image.height=h.height,l.image.data=h.data),l.wrapS=h.wrapS!==void 0?h.wrapS:Ks,l.wrapT=h.wrapT!==void 0?h.wrapT:Ks,l.magFilter=h.magFilter!==void 0?h.magFilter:ts,l.minFilter=h.minFilter!==void 0?h.minFilter:ts,l.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0&&(l.colorSpace=h.colorSpace),h.flipY!==void 0&&(l.flipY=h.flipY),h.format!==void 0&&(l.format=h.format),h.type!==void 0&&(l.type=h.type),h.mipmaps!==void 0&&(l.mipmaps=h.mipmaps,l.minFilter=pm),h.mipmapCount===1&&(l.minFilter=ts),h.generateMipmaps!==void 0&&(l.generateMipmaps=h.generateMipmaps),l.needsUpdate=!0,t&&t(l,h)},i,r),l}}class sY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=new vi,l=new Kp(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(o){a.image=o,a.needsUpdate=!0,t!==void 0&&t(a)},i,r),a}}class Rl extends Cn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Vt(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class qI extends Rl{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Cn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Vt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const h_=new tn,Rw=new se,Ow=new se;class wb{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qe(512,512),this.mapType=G0,this.map=null,this.mapPass=null,this.matrix=new tn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rb,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new is(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Rw.setFromMatrixPosition(e.matrixWorld),t.position.copy(Rw),Ow.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ow),t.updateMatrixWorld(),h_.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(h_,t.coordinateSystem,t.reversedDepth),t.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(h_)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class VI extends wb{constructor(){super(new Qr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,i=Yh*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||t.far;(i!==t.fov||r!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=r,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class WI extends Rl{constructor(e,t,i=0,r=Math.PI/3,a=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Cn.DEFAULT_UP),this.updateMatrix(),this.target=new Cn,this.distance=i,this.angle=r,this.penumbra=a,this.decay=l,this.map=null,this.shadow=new VI}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class $I extends wb{constructor(){super(new Qr(90,1,.5,500)),this.isPointLightShadow=!0}}class GI extends Rl{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new $I}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class v2 extends J0{constructor(e=-1,t=1,i=1,r=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,a,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=i-e,l=i+e,o=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=h*this.view.offsetX,l=a+h*this.view.width,o-=p*this.view.offsetY,u=o-p*this.view.height}this.projectionMatrix.makeOrthographic(a,l,o,u,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class KI extends wb{constructor(){super(new v2(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class YI extends Rl{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Cn.DEFAULT_UP),this.updateMatrix(),this.target=new Cn,this.shadow=new KI}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class XI extends Rl{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ZI extends Rl{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class x2{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new se)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*r),t.addScaledVector(l[2],.488603*a),t.addScaledVector(l[3],.488603*i),t.addScaledVector(l[4],1.092548*(i*r)),t.addScaledVector(l[5],1.092548*(r*a)),t.addScaledVector(l[6],.315392*(3*a*a-1)),t.addScaledVector(l[7],1.092548*(i*a)),t.addScaledVector(l[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],2*.511664*r),t.addScaledVector(l[2],2*.511664*a),t.addScaledVector(l[3],2*.511664*i),t.addScaledVector(l[4],2*.429043*i*r),t.addScaledVector(l[5],2*.429043*r*a),t.addScaledVector(l[6],.743125*a*a-.247708),t.addScaledVector(l[7],2*.429043*i*a),t.addScaledVector(l[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,a=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*a,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*a,t[6]=.315392*(3*a*a-1),t[7]=1.092548*i*a,t[8]=.546274*(i*i-r*r)}}class JI extends Rl{constructor(e=new x2,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Cb extends Pr{constructor(e){super(e),this.textures={}}load(e,t,i,r){const a=this,l=new zo(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):wn(u),a.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(a){return t[a]===void 0&&zt("MaterialLoader: Undefined texture",a),t[a]}const r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Vt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const l=e.uniforms[a];switch(r.uniforms[a]={},l.type){case"t":r.uniforms[a].value=i(l.value);break;case"c":r.uniforms[a].value=new Vt().setHex(l.value);break;case"v2":r.uniforms[a].value=new Qe().fromArray(l.value);break;case"v3":r.uniforms[a].value=new se().fromArray(l.value);break;case"v4":r.uniforms[a].value=new is().fromArray(l.value);break;case"m3":r.uniforms[a].value=new ea().fromArray(l.value);break;case"m4":r.uniforms[a].value=new tn().fromArray(l.value);break;default:r.uniforms[a].value=l.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const a in e.extensions)r.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),r.normalScale=new Qe().fromArray(a)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Qe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Cb.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:wI,SpriteMaterial:i2,RawShaderMaterial:CI,ShaderMaterial:Z0,PointsMaterial:a2,MeshPhysicalMaterial:EI,MeshStandardMaterial:ld,MeshPhongMaterial:kI,MeshToonMaterial:AI,MeshNormalMaterial:TI,MeshLambertMaterial:MI,MeshDepthMaterial:RI,MeshDistanceMaterial:OI,MeshBasicMaterial:du,MeshMatcapMaterial:NI,LineDashedMaterial:DI,LineBasicMaterial:cr,Material:lr};return new t[e]}}class Nw{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class QI extends an{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class eL extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(o){try{t(a.parse(JSON.parse(o)))}catch(u){r?r(u):wn(u),a.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(g,_){if(t[_]!==void 0)return t[_];const v=g.interleavedBuffers[_],x=a(g,v.buffer),S=Qc(v.type,x),b=new nb(S,v.stride);return b.uuid=v.uuid,t[_]=b,b}function a(g,_){if(i[_]!==void 0)return i[_];const v=g.arrayBuffers[_],x=new Uint32Array(v).buffer;return i[_]=x,x}const l=e.isInstancedBufferGeometry?new QI:new an,o=e.data.index;if(o!==void 0){const g=Qc(o.type,o.array);l.setIndex(new ii(g,1))}const u=e.data.attributes;for(const g in u){const _=u[g];let w;if(_.isInterleavedBufferAttribute){const v=r(e.data,_.data);w=new ru(v,_.itemSize,_.offset,_.normalized)}else{const v=Qc(_.type,_.array),x=_.isInstancedBufferAttribute?Xh:ii;w=new x(v,_.itemSize,_.normalized)}_.name!==void 0&&(w.name=_.name),_.usage!==void 0&&w.setUsage(_.usage),l.setAttribute(g,w)}const h=e.data.morphAttributes;if(h)for(const g in h){const _=h[g],w=[];for(let v=0,x=_.length;v<x;v++){const S=_[v];let b;if(S.isInterleavedBufferAttribute){const C=r(e.data,S.data);b=new ru(C,S.itemSize,S.offset,S.normalized)}else{const C=Qc(S.type,S.array);b=new ii(C,S.itemSize,S.normalized)}S.name!==void 0&&(b.name=S.name),w.push(b)}l.morphAttributes[g]=w}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const f=e.data.groups||e.data.drawcalls||e.data.offsets;if(f!==void 0)for(let g=0,_=f.length;g!==_;++g){const w=f[g];l.addGroup(w.start,w.count,w.materialIndex)}const m=e.data.boundingSphere;return m!==void 0&&(l.boundingSphere=new Xi().fromJSON(m)),e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class aY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=this.path===""?Nw.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const o=new zo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){let h=null;try{h=JSON.parse(u)}catch(f){r!==void 0&&r(f),f("ObjectLoader: Can't parse "+e+".",f.message);return}const p=h.metadata;if(p===void 0||p.type===void 0||p.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),wn("ObjectLoader: Can't load "+e);return}a.parse(h,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Nw.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const a=new zo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const l=await a.loadAsync(e,t),o=JSON.parse(l),u=o.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(o)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,r),l=this.parseImages(e.images,function(){t!==void 0&&t(h)}),o=this.parseTextures(e.textures,l),u=this.parseMaterials(e.materials,o),h=this.parseObject(e.object,a,u,o,i),p=this.parseSkeletons(e.skeletons,h);if(this.bindSkeletons(h,p),this.bindLightTargets(h),t!==void 0){let f=!1;for(const m in l)if(l[m].data instanceof HTMLImageElement){f=!0;break}f===!1&&t(h)}return h}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,l),u=this.parseObject(e.object,r,o,l,t),h=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,h),this.bindLightTargets(u),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const a=new tu().fromJSON(e[i]);t[a.uuid]=a}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(a){a.isBone&&(r[a.uuid]=a)}),e!==void 0)for(let a=0,l=e.length;a<l;a++){const o=new ib().fromJSON(e[a],r);i[o.uuid]=o}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new eL;for(let a=0,l=e.length;a<l;a++){let o;const u=e[a];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(u);break;default:u.type in Mw?o=Mw[u.type].fromJSON(u,t):zt(`ObjectLoader: Unsupported geometry type "${u.type}"`)}o.uuid=u.uuid,u.name!==void 0&&(o.name=u.name),u.userData!==void 0&&(o.userData=u.userData),i[u.uuid]=o}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const a=new Cb;a.setTextures(t);for(let l=0,o=e.length;l<o;l++){const u=e[l];i[u.uuid]===void 0&&(i[u.uuid]=a.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],a=Gp.parse(r);t[a.uuid]=a}return t}parseImages(e,t){const i=this,r={};let a;function l(u){return i.manager.itemStart(u),a.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function o(u){if(typeof u=="string"){const h=u,p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:i.resourcePath+h;return l(p)}else return u.data?{data:Qc(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new b2(t);a=new Kp(u),a.setCrossOrigin(this.crossOrigin);for(let h=0,p=e.length;h<p;h++){const f=e[h],m=f.url;if(Array.isArray(m)){const g=[];for(let _=0,w=m.length;_<w;_++){const v=m[_],x=o(v);x!==null&&(x instanceof HTMLImageElement?g.push(x):g.push(new Fa(x.data,x.width,x.height)))}r[f.uuid]=new Sl(g)}else{const g=o(f.url);r[f.uuid]=new Sl(g)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function a(l){if(typeof l=="string"){const o=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:t.resourcePath+o;return await r.loadAsync(u)}else return l.data?{data:Qc(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){r=new Kp(this.manager),r.setCrossOrigin(this.crossOrigin);for(let l=0,o=e.length;l<o;l++){const u=e[l],h=u.url;if(Array.isArray(h)){const p=[];for(let f=0,m=h.length;f<m;f++){const g=h[f],_=await a(g);_!==null&&(_ instanceof HTMLImageElement?p.push(_):p.push(new Fa(_.data,_.width,_.height)))}i[u.uuid]=new Sl(p)}else{const p=await a(u.url);i[u.uuid]=new Sl(p)}}}return i}parseTextures(e,t){function i(a,l){return typeof a=="number"?a:(zt("ObjectLoader.parseTexture: Constant should be in numeric form.",a),l[a])}const r={};if(e!==void 0)for(let a=0,l=e.length;a<l;a++){const o=e[a];o.image===void 0&&zt('ObjectLoader: No "image" specified for',o.uuid),t[o.image]===void 0&&zt("ObjectLoader: Undefined image",o.image);const u=t[o.image],h=u.data;let p;Array.isArray(h)?(p=new Q0,h.length===6&&(p.needsUpdate=!0)):(h&&h.data?p=new Fa:p=new vi,h&&(p.needsUpdate=!0)),p.source=u,p.uuid=o.uuid,o.name!==void 0&&(p.name=o.name),o.mapping!==void 0&&(p.mapping=i(o.mapping,tL)),o.channel!==void 0&&(p.channel=o.channel),o.offset!==void 0&&p.offset.fromArray(o.offset),o.repeat!==void 0&&p.repeat.fromArray(o.repeat),o.center!==void 0&&p.center.fromArray(o.center),o.rotation!==void 0&&(p.rotation=o.rotation),o.wrap!==void 0&&(p.wrapS=i(o.wrap[0],Dw),p.wrapT=i(o.wrap[1],Dw)),o.format!==void 0&&(p.format=o.format),o.internalFormat!==void 0&&(p.internalFormat=o.internalFormat),o.type!==void 0&&(p.type=o.type),o.colorSpace!==void 0&&(p.colorSpace=o.colorSpace),o.minFilter!==void 0&&(p.minFilter=i(o.minFilter,Iw)),o.magFilter!==void 0&&(p.magFilter=i(o.magFilter,Iw)),o.anisotropy!==void 0&&(p.anisotropy=o.anisotropy),o.flipY!==void 0&&(p.flipY=o.flipY),o.generateMipmaps!==void 0&&(p.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(p.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(p.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(p.compareFunction=o.compareFunction),o.userData!==void 0&&(p.userData=o.userData),r[o.uuid]=p}return r}parseObject(e,t,i,r,a){let l;function o(m){return t[m]===void 0&&zt("ObjectLoader: Undefined geometry",m),t[m]}function u(m){if(m!==void 0){if(Array.isArray(m)){const g=[];for(let _=0,w=m.length;_<w;_++){const v=m[_];i[v]===void 0&&zt("ObjectLoader: Undefined material",v),g.push(i[v])}return g}return i[m]===void 0&&zt("ObjectLoader: Undefined material",m),i[m]}}function h(m){return r[m]===void 0&&zt("ObjectLoader: Undefined texture",m),r[m]}let p,f;switch(e.type){case"Scene":l=new vD,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Vt(e.background):l.background=h(e.background)),e.environment!==void 0&&(l.environment=h(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new tb(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new eb(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new Qr(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new v2(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new XI(e.color,e.intensity);break;case"DirectionalLight":l=new YI(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new GI(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new ZI(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new WI(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new qI(e.color,e.groundColor,e.intensity);break;case"LightProbe":const m=new x2().fromArray(e.sh);l=new JI(m,e.intensity);break;case"SkinnedMesh":p=o(e.geometry),f=u(e.material),l=new CD(p,f),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":p=o(e.geometry),f=u(e.material),l=new Cs(p,f);break;case"InstancedMesh":p=o(e.geometry),f=u(e.material);const g=e.count,_=e.instanceMatrix,w=e.instanceColor;l=new AD(p,f,g),l.instanceMatrix=new Xh(new Float32Array(_.array),16),w!==void 0&&(l.instanceColor=new Xh(new Float32Array(w.array),w.itemSize));break;case"BatchedMesh":p=o(e.geometry),f=u(e.material),l=new PD(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,f),l.geometry=p,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._geometryInfo=e.geometryInfo.map(v=>{let x=null,S=null;return v.boundingBox!==void 0&&(x=new or().fromJSON(v.boundingBox)),v.boundingSphere!==void 0&&(S=new Xi().fromJSON(v.boundingSphere)),{...v,boundingBox:x,boundingSphere:S}}),l._instanceInfo=e.instanceInfo,l._availableInstanceIds=e._availableInstanceIds,l._availableGeometryIds=e._availableGeometryIds,l._nextIndexStart=e.nextIndexStart,l._nextVertexStart=e.nextVertexStart,l._geometryCount=e.geometryCount,l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._matricesTexture=h(e.matricesTexture.uuid),l._indirectTexture=h(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=h(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(l.boundingSphere=new Xi().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(l.boundingBox=new or().fromJSON(e.boundingBox));break;case"LOD":l=new SD;break;case"Line":l=new El(o(e.geometry),u(e.material));break;case"LineLoop":l=new FD(o(e.geometry),u(e.material));break;case"LineSegments":l=new Ha(o(e.geometry),u(e.material));break;case"PointCloud":case"Points":l=new jD(o(e.geometry),u(e.material));break;case"Sprite":l=new xD(u(e.material));break;case"Group":l=new Dh;break;case"Bone":l=new s2;break;default:l=new Cn}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let g=0;g<m.length;g++)l.add(this.parseObject(m[g],t,i,r,a))}if(e.animations!==void 0){const m=e.animations;for(let g=0;g<m.length;g++){const _=m[g];l.animations.push(a[_])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const m=e.levels;for(let g=0;g<m.length;g++){const _=m[g],w=l.getObjectByProperty("uuid",_.object);w!==void 0&&l.addLevel(w,_.distance,_.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?zt("ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const i=t.target,r=e.getObjectByProperty("uuid",i);r!==void 0?t.target=r:t.target=new Cn}})}}const tL={UVMapping:$0,CubeReflectionMapping:fm,CubeRefractionMapping:w3,EquirectangularReflectionMapping:C3,EquirectangularRefractionMapping:E3,CubeUVReflectionMapping:k3},Dw={RepeatWrapping:s0,ClampToEdgeWrapping:Ks,MirroredRepeatWrapping:a0},Iw={NearestFilter:Br,NearestMipmapNearestFilter:A3,NearestMipmapLinearFilter:T3,LinearFilter:ts,LinearMipmapNearestFilter:M3,LinearMipmapLinearFilter:pm},d_=new WeakMap;class oY extends Pr{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&zt("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&zt("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=za.get(`image-bitmap:${e}`);if(l!==void 0){if(a.manager.itemStart(e),l.then){l.then(h=>{if(d_.has(l)===!0)r&&r(d_.get(l)),a.manager.itemError(e),a.manager.itemEnd(e);else return t&&t(h),a.manager.itemEnd(e),h});return}return setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0),l}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const u=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(h){return za.add(`image-bitmap:${e}`,h),t&&t(h),a.manager.itemEnd(e),h}).catch(function(h){r&&r(h),d_.set(u,h),za.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});za.add(`image-bitmap:${e}`,u),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let lp,S2=class{static getContext(){return lp===void 0&&(lp=new(window.AudioContext||window.webkitAudioContext)),lp}static setContext(e){lp=e}};class cY extends Pr{constructor(e){super(e)}load(e,t,i,r){const a=this,l=new zo(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{const h=u.slice(0);S2.getContext().decodeAudioData(h,function(f){t(f)}).catch(o)}catch(h){o(h)}},i,r);function o(u){r?r(u):wn(u),a.manager.itemError(e)}}}const Lw=new tn,Bw=new tn,pl=new tn;class uY{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,pl.copy(e.projectionMatrix);const r=t.eyeSep/2,a=r*t.near/t.focus,l=t.near*Math.tan(Cl*t.fov*.5)/t.zoom;let o,u;Bw.elements[12]=-r,Lw.elements[12]=r,o=-l*t.aspect+a,u=l*t.aspect+a,pl.elements[0]=2*t.near/(u-o),pl.elements[8]=(u+o)/(u-o),this.cameraL.projectionMatrix.copy(pl),o=-l*t.aspect-a,u=l*t.aspect-a,pl.elements[0]=2*t.near/(u-o),pl.elements[8]=(u+o)/(u-o),this.cameraR.projectionMatrix.copy(pl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Bw),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Lw)}}class hY extends Qr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class nL{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const ml=new se,f_=new Ir,iL=new se,gl=new se,yl=new se;class dY extends Cn{constructor(){super(),this.type="AudioListener",this.context=S2.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new nL}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ml,f_,iL),gl.set(0,0,-1).applyQuaternion(f_),yl.set(0,1,0).applyQuaternion(f_),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ml.x,i),t.positionY.linearRampToValueAtTime(ml.y,i),t.positionZ.linearRampToValueAtTime(ml.z,i),t.forwardX.linearRampToValueAtTime(gl.x,i),t.forwardY.linearRampToValueAtTime(gl.y,i),t.forwardZ.linearRampToValueAtTime(gl.z,i),t.upX.linearRampToValueAtTime(yl.x,i),t.upY.linearRampToValueAtTime(yl.y,i),t.upZ.linearRampToValueAtTime(yl.z,i)}else t.setPosition(ml.x,ml.y,ml.z),t.setOrientation(gl.x,gl.y,gl.z,yl.x,yl.y,yl.z)}}class rL extends Cn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){zt("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){zt("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){zt("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){zt("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){zt("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(zt("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){zt("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(zt("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const _l=new se,zw=new Ir,sL=new se,bl=new se;class fY extends rL{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_l,zw,sL),bl.set(0,0,1).applyQuaternion(zw);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_l.x,i),t.positionY.linearRampToValueAtTime(_l.y,i),t.positionZ.linearRampToValueAtTime(_l.z,i),t.orientationX.linearRampToValueAtTime(bl.x,i),t.orientationY.linearRampToValueAtTime(bl.y,i),t.orientationZ.linearRampToValueAtTime(bl.z,i)}else t.setPosition(_l.x,_l.y,_l.z),t.setOrientation(bl.x,bl.y,bl.z)}}class pY{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class aL{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,a,l;switch(t){case"quaternion":r=this._slerp,a=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,a=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,a=e*r+r;let l=this.cumulativeWeight;if(l===0){for(let o=0;o!==r;++o)i[a+o]=i[o];l=t}else{l+=t;const o=t/l;this._mixBufferRegion(i,a,0,o,r)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,a=this.cumulativeWeight,l=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-a,t)}l>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,h=t+t;u!==h;++u)if(i[u]!==i[u+t]){o.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let a=i,l=r;a!==l;++a)t[a]=t[r+a%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,a){if(r>=.5)for(let l=0;l!==a;++l)e[t+l]=e[i+l]}_slerp(e,t,i,r){Ir.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,a){const l=this._workIndex*a;Ir.multiplyQuaternionsFlat(e,l,e,t,e,i),Ir.slerpFlat(e,t,e,t,e,l,r)}_lerp(e,t,i,r,a){const l=1-r;for(let o=0;o!==a;++o){const u=t+o;e[u]=e[u]*l+e[i+o]*r}}_lerpAdditive(e,t,i,r,a){for(let l=0;l!==a;++l){const o=t+l;e[o]=e[o]+e[i+l]*r}}}const Eb="\\[\\]\\.:\\/",oL=new RegExp("["+Eb+"]","g"),kb="[^"+Eb+"]",lL="[^"+Eb.replace("\\.","")+"]",cL=/((?:WC+[\/:])*)/.source.replace("WC",kb),uL=/(WCOD+)?/.source.replace("WCOD",lL),hL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",kb),dL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",kb),fL=new RegExp("^"+cL+uL+hL+dL+"$"),pL=["material","materials","bones","map"];class mL{constructor(e,t,i){const r=i||Sn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=i.length;r!==a;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Sn{constructor(e,t,i){this.path=t,this.parsedPath=i||Sn.parseTrackName(t),this.node=Sn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Sn.Composite(e,t,i):new Sn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(oL,"")}static parseTrackName(e){const t=fL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const a=i.nodeName.substring(r+1);pL.indexOf(a)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=a)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(a){for(let l=0;l<a.length;l++){const o=a[l];if(o.name===t||o.uuid===t)return o;const u=i(o.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let a=t.propertyIndex;if(e||(e=Sn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){zt("PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let h=t.objectIndex;switch(i){case"materials":if(!e.material){wn("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){wn("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){wn("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===h){h=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){wn("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){wn("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){wn("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(h!==void 0){if(e[h]===void 0){wn("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const l=e[r];if(l===void 0){const h=t.nodeName;wn("PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){wn("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){wn("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else l.fromArray!==void 0&&l.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Sn.Composite=mL;Sn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Sn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Sn.prototype.GetterByBindingType=[Sn.prototype._getValue_direct,Sn.prototype._getValue_array,Sn.prototype._getValue_arrayElement,Sn.prototype._getValue_toArray];Sn.prototype.SetterByBindingTypeAndVersioning=[[Sn.prototype._setValue_direct,Sn.prototype._setValue_direct_setNeedsUpdate,Sn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Sn.prototype._setValue_array,Sn.prototype._setValue_array_setNeedsUpdate,Sn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Sn.prototype._setValue_arrayElement,Sn.prototype._setValue_arrayElement_setNeedsUpdate,Sn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Sn.prototype._setValue_fromArray,Sn.prototype._setValue_fromArray_setNeedsUpdate,Sn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class mY{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Dr(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,a=this._bindings,l=a.length;let o,u=e.length,h=this.nCachedObjects_;for(let p=0,f=arguments.length;p!==f;++p){const m=arguments[p],g=m.uuid;let _=t[g];if(_===void 0){_=u++,t[g]=_,e.push(m);for(let w=0,v=l;w!==v;++w)a[w].push(new Sn(m,i[w],r[w]))}else if(_<h){o=e[_];const w=--h,v=e[w];t[v.uuid]=_,e[_]=v,t[g]=w,e[w]=m;for(let x=0,S=l;x!==S;++x){const b=a[x],C=b[w];let O=b[_];b[_]=C,O===void 0&&(O=new Sn(m,i[x],r[x])),b[w]=O}}else e[_]!==o&&wn("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_;for(let l=0,o=arguments.length;l!==o;++l){const u=arguments[l],h=u.uuid,p=t[h];if(p!==void 0&&p>=a){const f=a++,m=e[f];t[m.uuid]=p,e[p]=m,t[h]=f,e[f]=u;for(let g=0,_=r;g!==_;++g){const w=i[g],v=w[f],x=w[p];w[p]=v,w[f]=x}}}this.nCachedObjects_=a}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_,l=e.length;for(let o=0,u=arguments.length;o!==u;++o){const h=arguments[o],p=h.uuid,f=t[p];if(f!==void 0)if(delete t[p],f<a){const m=--a,g=e[m],_=--l,w=e[_];t[g.uuid]=f,e[f]=g,t[w.uuid]=m,e[m]=w,e.pop();for(let v=0,x=r;v!==x;++v){const S=i[v],b=S[m],C=S[_];S[f]=b,S[m]=C,S.pop()}}else{const m=--l,g=e[m];m>0&&(t[g.uuid]=f),e[f]=g,e.pop();for(let _=0,w=r;_!==w;++_){const v=i[_];v[f]=v[m],v.pop()}}}this.nCachedObjects_=a}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const a=this._bindings;if(r!==void 0)return a[r];const l=this._paths,o=this._parsedPaths,u=this._objects,h=u.length,p=this.nCachedObjects_,f=new Array(h);r=a.length,i[e]=r,l.push(e),o.push(t),a.push(f);for(let m=p,g=u.length;m!==g;++m){const _=u[m];f[m]=new Sn(_,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,a=this._parsedPaths,l=this._bindings,o=l.length-1,u=l[o],h=e[o];t[h]=i,l[i]=u,l.pop(),a[i]=a[o],a.pop(),r[i]=r[o],r.pop()}}}class gL{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const a=t.tracks,l=a.length,o=new Array(l),u={endingStart:Zc,endingEnd:Zc};for(let h=0;h!==l;++h){const p=a[h].createInterpolant(null);o[h]=p,p.settings=u}this._interpolantSettings=u,this._interpolants=o,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=TN,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const r=this._clip.duration,a=e._clip.duration,l=a/r,o=r/a;e.warp(1,l,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,a=r.time,l=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const u=o.parameterPositions,h=o.sampleValues;return u[0]=a,u[1]=a+i,h[0]=e/l,h[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const u=(e-a)*i;u<0||i===0?t=0:(this._startTime=null,t=i*u)}t*=this._updateTimeScale(e);const l=this._updateTime(t),o=this._updateWeight(e);if(o>0){const u=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case XE:for(let p=0,f=u.length;p!==f;++p)u[p].evaluate(l),h[p].accumulateAdditive(o);break;case K0:default:for(let p=0,f=u.length;p!==f;++p)u[p].evaluate(l),h[p].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,a=this._loopCount;const l=i===MN;if(e===0)return a===-1?r:l&&(a&1)===1?t-r:r;if(i===AN){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),r>=t||r<0){const o=Math.floor(r/t);r-=t*o,a+=Math.abs(o);const u=this.repetitions-a;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const h=e<0;this._setEndings(h,!h,l)}else this._setEndings(!1,!1,l);this._loopCount=a,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(l&&(a&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Jc,r.endingEnd=Jc):(e?r.endingStart=this.zeroSlopeAtStart?Jc:Zc:r.endingStart=Fp,t?r.endingEnd=this.zeroSlopeAtEnd?Jc:Zc:r.endingEnd=Fp)}_scheduleFading(e,t,i){const r=this._mixer,a=r.time;let l=this._weightInterpolant;l===null&&(l=r._lendControlInterpolant(),this._weightInterpolant=l);const o=l.parameterPositions,u=l.sampleValues;return o[0]=a,u[0]=t,o[1]=a+e,u[1]=i,this}}const yL=new Float32Array(1);class gY extends Po{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,a=r.length,l=e._propertyBindings,o=e._interpolants,u=i.uuid,h=this._bindingsByRootAndName;let p=h[u];p===void 0&&(p={},h[u]=p);for(let f=0;f!==a;++f){const m=r[f],g=m.name;let _=p[g];if(_!==void 0)++_.referenceCount,l[f]=_;else{if(_=l[f],_!==void 0){_._cacheIndex===null&&(++_.referenceCount,this._addInactiveBinding(_,u,g));continue}const w=t&&t._propertyBindings[f].binding.parsedPath;_=new aL(Sn.create(i,g,w),m.ValueTypeName,m.getValueSize()),++_.referenceCount,this._addInactiveBinding(_,u,g),l[f]=_}o[f].resultBuffer=_.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,a=this._actionsByClip[r];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[i];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[i];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,a=this._actionsByClip;let l=a[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=l;else{const o=l.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),l.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const a=e._clip.uuid,l=this._actionsByClip,o=l[a],u=o.knownActions,h=u[u.length-1],p=e._byClipCacheIndex;h._byClipCacheIndex=p,u[p]=h,u.pop(),e._byClipCacheIndex=null;const f=o.actionByRoot,m=(e._localRoot||this._root).uuid;delete f[m],u.length===0&&delete l[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const a=t[i];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,a=this._bindings;let l=r[t];l===void 0&&(l={},r[t]=l),l[i]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,a=i.path,l=this._bindingsByRootAndName,o=l[r],u=t[t.length-1],h=e._cacheIndex;u._cacheIndex=h,t[h]=u,t.pop(),delete o[a],Object.keys(o).length===0&&delete l[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new y2(new Float32Array(2),new Float32Array(2),1,yL),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=t[r];e.__cacheIndex=r,t[r]=e,a.__cacheIndex=i,t[i]=a}clipAction(e,t,i){const r=t||this._root,a=r.uuid;let l=typeof e=="string"?Gp.findByName(r,e):e;const o=l!==null?l.uuid:e,u=this._actionsByClip[o];let h=null;if(i===void 0&&(l!==null?i=l.blendMode:i=K0),u!==void 0){const f=u.actionByRoot[a];if(f!==void 0&&f.blendMode===i)return f;h=u.knownActions[0],l===null&&(l=h._clip)}if(l===null)return null;const p=new gL(this,l,t,i);return this._bindAction(p,h),this._addInactiveAction(p,o,a),p}existingAction(e,t){const i=t||this._root,r=i.uuid,a=typeof e=="string"?Gp.findByName(i,e):e,l=a?a.uuid:e,o=this._actionsByClip[l];return o!==void 0&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,a=Math.sign(e),l=this._accuIndex^=1;for(let h=0;h!==i;++h)t[h]._update(r,e,a,l);const o=this._bindings,u=this._nActiveBindings;for(let h=0;h!==u;++h)o[h].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,a=r[i];if(a!==void 0){const l=a.knownActions;for(let o=0,u=l.length;o!==u;++o){const h=l[o];this._deactivateAction(h);const p=h._cacheIndex,f=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,f._cacheIndex=p,t[p]=f,t.pop(),this._removeInactiveBindingsForAction(h)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const l in i){const o=i[l].actionByRoot,u=o[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,a=r[t];if(a!==void 0)for(const l in a){const o=a[l];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class yY extends QE{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new e2(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class w2{constructor(e){this.value=e}clone(){return new w2(this.value.clone===void 0?this.value:this.value.clone())}}let _L=0;class _Y extends Po{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:_L++}),this.name="",this.usage=jp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++){const a=Array.isArray(t[i])?t[i]:[t[i]];for(let l=0;l<a.length;l++)this.uniforms.push(a[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class bY extends nb{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class vY{constructor(e,t,i,r,a,l=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=a,this.normalized=l,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Pw=new tn;class xY{constructor(e,t,i=0,r=1/0){this.ray=new ad(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new t2,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):wn("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Pw.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Pw),this}intersectObject(e,t=!0,i=[]){return p0(e,this,i,t),i.sort(Fw),i}intersectObjects(e,t=!0,i=[]){for(let r=0,a=e.length;r<a;r++)p0(e[r],this,i,t);return i.sort(Fw),i}}function Fw(n,e){return n.distance-e.distance}function p0(n,e,t,i){let r=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(r=!1),r===!0&&i===!0){const a=n.children;for(let l=0,o=a.length;l<o;l++)p0(a[l],e,t,!0)}}class SY{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=bL.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function bL(){this._document.hidden===!1&&this.reset()}class wY{constructor(e=1,t=0,i=0){this.radius=e,this.phi=t,this.theta=i}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=jt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(jt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class CY{constructor(e=1,t=0,i=0){this.radius=e,this.theta=t,this.y=i}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}class C2{constructor(e,t,i,r){C2.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){const a=this.elements;return a[0]=e,a[2]=t,a[1]=i,a[3]=r,this}}const jw=new Qe;class EY{constructor(e=new Qe(1/0,1/0),t=new Qe(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=jw.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,jw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Uw=new se,cp=new se,qc=new se,Vc=new se,p_=new se,vL=new se,xL=new se;class kY{constructor(e=new se,t=new se){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Uw.subVectors(e,this.start),cp.subVectors(this.end,this.start);const i=cp.dot(cp);let a=cp.dot(Uw)/i;return t&&(a=jt(a,0,1)),a}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=vL,i=xL){const r=10000000000000001e-32;let a,l;const o=this.start,u=e.start,h=this.end,p=e.end;qc.subVectors(h,o),Vc.subVectors(p,u),p_.subVectors(o,u);const f=qc.dot(qc),m=Vc.dot(Vc),g=Vc.dot(p_);if(f<=r&&m<=r)return t.copy(o),i.copy(u),t.sub(i),t.dot(t);if(f<=r)a=0,l=g/m,l=jt(l,0,1);else{const _=qc.dot(p_);if(m<=r)l=0,a=jt(-_/f,0,1);else{const w=qc.dot(Vc),v=f*m-w*w;v!==0?a=jt((w*g-_*m)/v,0,1):a=0,l=(w*a+g)/m,l<0?(l=0,a=jt(-_/f,0,1)):l>1&&(l=1,a=jt((w-_)/f,0,1))}}return t.copy(o).add(qc.multiplyScalar(a)),i.copy(u).add(Vc.multiplyScalar(l)),t.sub(i),t.dot(t)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Hw=new se;class AY extends Cn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new an,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let l=0,o=1,u=32;l<u;l++,o++){const h=l/u*Math.PI*2,p=o/u*Math.PI*2;r.push(Math.cos(h),Math.sin(h),1,Math.cos(p),Math.sin(p),1)}i.setAttribute("position",new xt(r,3));const a=new cr({fog:!1,toneMapped:!1});this.cone=new Ha(i,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Hw.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Hw),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Oo=new se,up=new tn,m_=new tn;class TY extends Ha{constructor(e){const t=E2(e),i=new an,r=[],a=[];for(let h=0;h<t.length;h++){const p=t[h];p.parent&&p.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),a.push(0,0,0),a.push(0,0,0))}i.setAttribute("position",new xt(r,3)),i.setAttribute("color",new xt(a,3));const l=new cr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Vt(255),u=new Vt(65280);this.setColors(o,u)}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");m_.copy(this.root.matrixWorld).invert();for(let a=0,l=0;a<t.length;a++){const o=t[a];o.parent&&o.parent.isBone&&(up.multiplyMatrices(m_,o.matrixWorld),Oo.setFromMatrixPosition(up),r.setXYZ(l,Oo.x,Oo.y,Oo.z),up.multiplyMatrices(m_,o.parent.matrixWorld),Oo.setFromMatrixPosition(up),r.setXYZ(l+1,Oo.x,Oo.y,Oo.z),l+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const r=this.geometry.getAttribute("color");for(let a=0;a<r.count;a+=2)r.setXYZ(a,e.r,e.g,e.b),r.setXYZ(a+1,t.r,t.g,t.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function E2(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push(...E2(n.children[t]));return e}class MY extends Cs{constructor(e,t,i){const r=new xs(t,4,2),a=new du({wireframe:!0,fog:!1,toneMapped:!1});super(r,a),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const SL=new se,qw=new Vt,Vw=new Vt;class RY extends Cn{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new _m(t);r.rotateY(Math.PI*.5),this.material=new du({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=r.getAttribute("position"),l=new Float32Array(a.count*3);r.setAttribute("color",new ii(l,3)),this.add(new Cs(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");qw.copy(this.light.color),Vw.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const a=i<r/2?qw:Vw;t.setXYZ(i,a.r,a.g,a.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(SL.setFromMatrixPosition(this.light.matrixWorld).negate())}}class OY extends Ha{constructor(e=10,t=10,i=4473924,r=8947848){i=new Vt(i),r=new Vt(r);const a=t/2,l=e/t,o=e/2,u=[],h=[];for(let m=0,g=0,_=-o;m<=t;m++,_+=l){u.push(-o,0,_,o,0,_),u.push(_,0,-o,_,0,o);const w=m===a?i:r;w.toArray(h,g),g+=3,w.toArray(h,g),g+=3,w.toArray(h,g),g+=3,w.toArray(h,g),g+=3}const p=new an;p.setAttribute("position",new xt(u,3)),p.setAttribute("color",new xt(h,3));const f=new cr({vertexColors:!0,toneMapped:!1});super(p,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class NY extends Ha{constructor(e=10,t=16,i=8,r=64,a=4473924,l=8947848){a=new Vt(a),l=new Vt(l);const o=[],u=[];if(t>1)for(let f=0;f<t;f++){const m=f/t*(Math.PI*2),g=Math.sin(m)*e,_=Math.cos(m)*e;o.push(0,0,0),o.push(g,0,_);const w=f&1?a:l;u.push(w.r,w.g,w.b),u.push(w.r,w.g,w.b)}for(let f=0;f<i;f++){const m=f&1?a:l,g=e-e/i*f;for(let _=0;_<r;_++){let w=_/r*(Math.PI*2),v=Math.sin(w)*g,x=Math.cos(w)*g;o.push(v,0,x),u.push(m.r,m.g,m.b),w=(_+1)/r*(Math.PI*2),v=Math.sin(w)*g,x=Math.cos(w)*g,o.push(v,0,x),u.push(m.r,m.g,m.b)}}const h=new an;h.setAttribute("position",new xt(o,3)),h.setAttribute("color",new xt(u,3));const p=new cr({vertexColors:!0,toneMapped:!1});super(h,p),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Ww=new se,hp=new se,$w=new se;class DY extends Cn{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new an;r.setAttribute("position",new xt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const a=new cr({fog:!1,toneMapped:!1});this.lightPlane=new El(r,a),this.add(this.lightPlane),r=new an,r.setAttribute("position",new xt([0,0,0,0,0,1],3)),this.targetLine=new El(r,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Ww.setFromMatrixPosition(this.light.matrixWorld),hp.setFromMatrixPosition(this.light.target.matrixWorld),$w.subVectors(hp,Ww),this.lightPlane.lookAt(hp),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(hp),this.targetLine.scale.z=$w.length()}}const dp=new se,oi=new J0;class IY extends Ha{constructor(e){const t=new an,i=new cr({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],l={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(_,w){u(_),u(w)}function u(_){r.push(0,0,0),a.push(0,0,0),l[_]===void 0&&(l[_]=[]),l[_].push(r.length/3-1)}t.setAttribute("position",new xt(r,3)),t.setAttribute("color",new xt(a,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const h=new Vt(16755200),p=new Vt(16711680),f=new Vt(43775),m=new Vt(16777215),g=new Vt(3355443);this.setColors(h,p,f,m,g)}setColors(e,t,i,r,a){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,t.r,t.g,t.b),o.setXYZ(25,t.r,t.g,t.b),o.setXYZ(26,t.r,t.g,t.b),o.setXYZ(27,t.r,t.g,t.b),o.setXYZ(28,t.r,t.g,t.b),o.setXYZ(29,t.r,t.g,t.b),o.setXYZ(30,t.r,t.g,t.b),o.setXYZ(31,t.r,t.g,t.b),o.setXYZ(32,i.r,i.g,i.b),o.setXYZ(33,i.r,i.g,i.b),o.setXYZ(34,i.r,i.g,i.b),o.setXYZ(35,i.r,i.g,i.b),o.setXYZ(36,i.r,i.g,i.b),o.setXYZ(37,i.r,i.g,i.b),o.setXYZ(38,r.r,r.g,r.b),o.setXYZ(39,r.r,r.g,r.b),o.setXYZ(40,a.r,a.g,a.b),o.setXYZ(41,a.r,a.g,a.b),o.setXYZ(42,a.r,a.g,a.b),o.setXYZ(43,a.r,a.g,a.b),o.setXYZ(44,a.r,a.g,a.b),o.setXYZ(45,a.r,a.g,a.b),o.setXYZ(46,a.r,a.g,a.b),o.setXYZ(47,a.r,a.g,a.b),o.setXYZ(48,a.r,a.g,a.b),o.setXYZ(49,a.r,a.g,a.b),o.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;let a,l;if(oi.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,l=0;else if(this.camera.coordinateSystem===Ys)a=-1,l=1;else if(this.camera.coordinateSystem===Kh)a=0,l=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);ui("c",t,e,oi,0,0,a),ui("t",t,e,oi,0,0,l),ui("n1",t,e,oi,-i,-r,a),ui("n2",t,e,oi,i,-r,a),ui("n3",t,e,oi,-i,r,a),ui("n4",t,e,oi,i,r,a),ui("f1",t,e,oi,-i,-r,l),ui("f2",t,e,oi,i,-r,l),ui("f3",t,e,oi,-i,r,l),ui("f4",t,e,oi,i,r,l),ui("u1",t,e,oi,i*.7,r*1.1,a),ui("u2",t,e,oi,-i*.7,r*1.1,a),ui("u3",t,e,oi,0,r*2,a),ui("cf1",t,e,oi,-i,0,l),ui("cf2",t,e,oi,i,0,l),ui("cf3",t,e,oi,0,-r,l),ui("cf4",t,e,oi,0,r,l),ui("cn1",t,e,oi,-i,0,a),ui("cn2",t,e,oi,i,0,a),ui("cn3",t,e,oi,0,-r,a),ui("cn4",t,e,oi,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ui(n,e,t,i,r,a,l){dp.set(r,a,l).unproject(i);const o=e[n];if(o!==void 0){const u=t.getAttribute("position");for(let h=0,p=o.length;h<p;h++)u.setXYZ(o[h],dp.x,dp.y,dp.z)}}const fp=new or;class LY extends Ha{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),a=new an;a.setIndex(new ii(i,1)),a.setAttribute("position",new ii(r,3)),super(a,new cr({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&fp.setFromObject(this.object),fp.isEmpty())return;const e=fp.min,t=fp.max,i=this.geometry.attributes.position,r=i.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=t.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class BY extends Ha{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new an;a.setIndex(new ii(i,1)),a.setAttribute("position",new xt(r,3)),super(a,new cr({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class zY extends El{constructor(e,t=1,i=16776960){const r=i,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new an;l.setAttribute("position",new xt(a,3)),l.computeBoundingSphere(),super(l,new cr({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],u=new an;u.setAttribute("position",new xt(o,3)),u.computeBoundingSphere(),this.add(new Cs(u,new du({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Gw=new se;let pp,g_;class PY extends Cn{constructor(e=new se(0,0,1),t=new se(0,0,0),i=1,r=16776960,a=i*.2,l=a*.2){super(),this.type="ArrowHelper",pp===void 0&&(pp=new an,pp.setAttribute("position",new xt([0,0,0,0,1,0],3)),g_=new ym(.5,1,5,1),g_.translate(0,-.5,0)),this.position.copy(t),this.line=new El(pp,new cr({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Cs(g_,new du({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,a,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Gw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Gw,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class FY extends Ha{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new an;r.setAttribute("position",new xt(t,3)),r.setAttribute("color",new xt(i,3));const a=new cr({vertexColors:!0,toneMapped:!1});super(r,a),this.type="AxesHelper"}setColors(e,t,i){const r=new Vt,a=this.geometry.attributes.color.array;return r.set(e),r.toArray(a,0),r.toArray(a,3),r.set(t),r.toArray(a,6),r.toArray(a,9),r.set(i),r.toArray(a,12),r.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class jY{constructor(){this.type="ShapePath",this.color=new Vt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new u0,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,a,l){return this.currentPath.bezierCurveTo(e,t,i,r,a,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(x){const S=[];for(let b=0,C=x.length;b<C;b++){const O=x[b],M=new tu;M.curves=O.curves,S.push(M)}return S}function i(x,S){const b=S.length;let C=!1;for(let O=b-1,M=0;M<b;O=M++){let D=S[O],N=S[M],B=N.x-D.x,U=N.y-D.y;if(Math.abs(U)>Number.EPSILON){if(U<0&&(D=S[M],B=-B,N=S[O],U=-U),x.y<D.y||x.y>N.y)continue;if(x.y===D.y){if(x.x===D.x)return!0}else{const Y=U*(x.x-D.x)-B*(x.y-D.y);if(Y===0)return!0;if(Y<0)continue;C=!C}}else{if(x.y!==D.y)continue;if(N.x<=x.x&&x.x<=D.x||D.x<=x.x&&x.x<=N.x)return!0}}return C}const r=Xs.isClockWise,a=this.subPaths;if(a.length===0)return[];let l,o,u;const h=[];if(a.length===1)return o=a[0],u=new tu,u.curves=o.curves,h.push(u),h;let p=!r(a[0].getPoints());p=e?!p:p;const f=[],m=[];let g=[],_=0,w;m[_]=void 0,g[_]=[];for(let x=0,S=a.length;x<S;x++)o=a[x],w=o.getPoints(),l=r(w),l=e?!l:l,l?(!p&&m[_]&&_++,m[_]={s:new tu,p:w},m[_].s.curves=o.curves,p&&_++,g[_]=[]):g[_].push({h:o,p:w[0]});if(!m[0])return t(a);if(m.length>1){let x=!1,S=0;for(let b=0,C=m.length;b<C;b++)f[b]=[];for(let b=0,C=m.length;b<C;b++){const O=g[b];for(let M=0;M<O.length;M++){const D=O[M];let N=!0;for(let B=0;B<m.length;B++)i(D.p,m[B].p)&&(b!==B&&S++,N?(N=!1,f[B].push(D)):x=!0);N&&f[b].push(D)}}S>0&&x===!1&&(g=f)}let v;for(let x=0,S=m.length;x<S;x++){u=m[x].s,h.push(u),v=g[x];for(let b=0,C=v.length;b<C;b++)u.holes.push(v[b].h)}return h}}class UY extends Po{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){zt("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function wL(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function CL(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function EL(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function kL(n,e,t,i){const r=AL(i);switch(t){case F3:return n*e;case KE:return n*e/r.components*r.byteLength;case YE:return n*e/r.components*r.byteLength;case H3:return n*e*2/r.components*r.byteLength;case q3:return n*e*2/r.components*r.byteLength;case j3:return n*e*3/r.components*r.byteLength;case Gh:return n*e*4/r.components*r.byteLength;case V3:return n*e*4/r.components*r.byteLength;case W3:case $3:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case G3:case K3:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case X3:case J3:return Math.max(n,16)*Math.max(e,8)/4;case Y3:case Z3:return Math.max(n,8)*Math.max(e,8)/2;case Q3:case eN:case nN:case iN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case tN:case rN:case sN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case aN:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case oN:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case lN:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case cN:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case uN:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case hN:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case dN:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case fN:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case pN:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case mN:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case gN:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case yN:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case _N:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case bN:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case vN:case xN:case SN:return Math.ceil(n/4)*Math.ceil(e/4)*16;case wN:case CN:return Math.ceil(n/4)*Math.ceil(e/4)*8;case EN:case kN:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function AL(n){switch(n){case G0:case R3:return{byteLength:1,components:1};case N3:case O3:case I3:return{byteLength:2,components:1};case L3:case B3:return{byteLength:2,components:4};case mm:case D3:case iu:return{byteLength:4,components:1};case z3:case P3:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class HY{static contain(e,t){return wL(e,t)}static cover(e,t){return CL(e,t)}static fill(e){return EL(e)}static getByteLength(e,t,i,r){return kL(e,t,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:$E}}));typeof window<"u"&&(window.__THREE__?zt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=$E);const Yp={robot:{type:"robot",label:"Robot",description:"Standard humanoid robot",head:{},torso:{},armL:{},armR:{},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},mech:{type:"mech",label:"Mech",description:"Bulkier torso, wider stance, angular head",head:{geometry:new Kn(.34,.2,.3),position:[0,1.36,0]},torso:{geometry:new Kn(.42,.44,.26),position:[0,.87,0]},armL:{geometry:new Kn(.11,.3,.11),position:[-.27,1.07,0]},armR:{geometry:new Kn(.11,.3,.11),position:[.27,1.07,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},drone:{type:"drone",label:"Drone",description:"Smaller hovering unit with antenna array",head:{geometry:new xs(.14,8,8),position:[0,1.2,0]},torso:{geometry:new Kn(.28,.18,.28),position:[0,.95,0]},armL:{geometry:new Kn(.22,.04,.06),position:[-.25,.95,0]},armR:{geometry:new Kn(.22,.04,.06),position:[.25,.95,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.3},spider:{type:"spider",label:"Spider",description:"Low body with 4 stubby legs",head:{geometry:new xs(.12,8,8),position:[0,.85,.1]},torso:{geometry:new Kn(.36,.14,.32),position:[0,.65,0]},armL:{geometry:new Kn(.06,.22,.06),position:[-.2,.65,-.12],scale:[1,1,1]},armR:{geometry:new Kn(.06,.22,.06),position:[.2,.65,-.12],scale:[1,1,1]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.05},orb:{type:"orb",label:"Orb",description:"Spherical body with stubby arms and short legs",head:{geometry:new xs(.1,8,8),position:[0,1.28,0]},torso:{geometry:new xs(.22,12,12),position:[0,.92,0]},armL:{geometry:new Kn(.06,.18,.06),position:[-.24,.92,0]},armR:{geometry:new Kn(.06,.18,.06),position:[.24,.92,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.2},tank:{type:"tank",label:"Tank",description:"Wide body with one thick arm, treads for legs",head:{geometry:new Kn(.24,.18,.22),position:[0,1.24,0]},torso:{geometry:new Kn(.44,.3,.26),position:[0,.87,0]},armL:{visible:!1},armR:{geometry:new Kn(.14,.34,.14),position:[.3,.87,0]},legL:{visible:!1},legR:{visible:!1},hovers:!0,baseY:.15}},TL=["robot","mech","drone","spider","orb","tank"];function qY(n){return Yp[n]??Yp.robot}function k2(n){return Yp[n]?.label??"Robot"}function ML(n){return Yp[n]?.description??""}const RL="_panel_9dulv_7",OL="_section_9dulv_12",NL="_tabs_9dulv_18",DL="_tab_9dulv_18",IL="_active_9dulv_21",LL="_autosaveIndicator_9dulv_30",BL="_visible_9dulv_31",zL="_themeGrid_9dulv_36",PL="_themeSwatch_9dulv_37",FL="_swatchColors_9dulv_40",jL="_swatchLabel_9dulv_42",UL="_fontSizeControl_9dulv_46",HL="_fontBtn_9dulv_47",qL="_fontSizeDisplay_9dulv_49",VL="_fontSizeSlider_9dulv_50",WL="_soundControls_9dulv_76",$L="_toggleLabel_9dulv_77",GL="_toggleSwitch_9dulv_80",KL="_volumeControl_9dulv_85",YL="_volumeDisplay_9dulv_87",XL="_soundActionGrid_9dulv_90",ZL="_soundCategoryLabel_9dulv_94",JL="_soundActionRow_9dulv_95",QL="_soundActionLabel_9dulv_97",eB="_soundActionSelect_9dulv_98",tB="_soundPreviewBtn_9dulv_101",nB="_densityControl_9dulv_106",iB="_densityBtn_9dulv_107",rB="_densityBtnLabel_9dulv_110",sB="_densityBtnDesc_9dulv_111",aB="_densityActions_9dulv_112",oB="_densityStatus_9dulv_113",lB="_hookStatusDot_9dulv_114",cB="_installed_9dulv_115",uB="_advancedActions_9dulv_118",hB="_settingsHint_9dulv_119",dB="_apiKeyRow_9dulv_122",fB="_apiKeyInput_9dulv_123",pB="_apiKeyToggle_9dulv_125",Ye={panel:RL,section:OL,tabs:NL,tab:DL,active:IL,autosaveIndicator:LL,visible:BL,themeGrid:zL,themeSwatch:PL,swatchColors:FL,swatchLabel:jL,fontSizeControl:UL,fontBtn:HL,fontSizeDisplay:qL,fontSizeSlider:VL,soundControls:WL,toggleLabel:$L,toggleSwitch:GL,volumeControl:KL,volumeDisplay:YL,soundActionGrid:XL,soundCategoryLabel:ZL,soundActionRow:JL,soundActionLabel:QL,soundActionSelect:eB,soundPreviewBtn:tB,densityControl:nB,densityBtn:iB,densityBtnLabel:rB,densityBtnDesc:sB,densityActions:aB,densityStatus:oB,hookStatusDot:lB,installed:cB,advancedActions:uB,settingsHint:hB,apiKeyRow:dB,apiKeyInput:fB,apiKeyToggle:pB};function mB(){const n=Gt(m=>m.themeName),e=Gt(m=>m.fontSize),t=Gt(m=>m.scanlineEnabled),i=Gt(m=>m.animationIntensity),r=Gt(m=>m.animationSpeed),a=Gt(m=>m.characterModel),l=Gt(m=>m.setThemeName),o=Gt(m=>m.setFontSize),u=Gt(m=>m.setScanlineEnabled),h=Gt(m=>m.setAnimationIntensity),p=Gt(m=>m.setAnimationSpeed),f=Gt(m=>m.setCharacterModel);return A.jsxs("div",{children:[A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Theme"}),A.jsx("div",{className:Ye.themeGrid,children:CO.map(m=>A.jsxs("button",{className:`${Ye.themeSwatch}${n===m.name?` ${Ye.active}`:""}`,onClick:()=>l(m.name),title:m.label,children:[A.jsx("div",{className:Ye.swatchColors,children:m.colors.map((g,_)=>A.jsx("span",{style:{background:g}},_))}),A.jsx("span",{className:Ye.swatchLabel,children:m.label})]},m.name))})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"3D Character Model"}),A.jsx("p",{style:{fontSize:"10px",color:"var(--text-dim)",marginBottom:"8px"},children:"Choose the robot model shown in the Cyberdrome"}),A.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:TL.map(m=>{const g=a===m;return A.jsxs("button",{onClick:()=>f(m),title:ML(m),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:"8px 4px",borderRadius:"4px",cursor:"pointer",transition:"all 0.15s ease",border:g?"1px solid var(--accent-cyan, #00e5ff)":"1px solid var(--border-subtle, rgba(255,255,255,0.08))",background:g?"rgba(0, 229, 255, 0.1)":"rgba(255, 255, 255, 0.02)",color:g?"var(--accent-cyan, #00e5ff)":"var(--text-secondary, #8888aa)",fontFamily:"var(--font-mono)",fontSize:"10px",letterSpacing:"0.5px"},children:[A.jsx(gB,{type:m,active:g}),A.jsx("span",{style:{textTransform:"uppercase",fontWeight:g?700:400},children:k2(m)})]},m)})})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Font Size"}),A.jsxs("div",{className:Ye.fontSizeControl,children:[A.jsx("button",{className:Ye.fontBtn,onClick:()=>o(Math.max(10,e-1)),children:"A-"}),A.jsxs("span",{className:Ye.fontSizeDisplay,children:[e,"px"]}),A.jsx("button",{className:Ye.fontBtn,onClick:()=>o(Math.min(20,e+1)),children:"A+"}),A.jsx("input",{type:"range",className:Ye.fontSizeSlider,min:10,max:20,step:1,value:e,onChange:m=>o(Number(m.target.value))})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Scanline Effect"}),A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:t,onChange:m=>u(m.target.checked)}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Enable scanline overlay"})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Animation"}),A.jsx("label",{style:{fontSize:"11px",color:"var(--text-secondary)",marginBottom:"6px",display:"block"},children:"Intensity (range of 3D robot movement)"}),A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Low"}),A.jsx("input",{type:"range",min:0,max:200,step:10,value:i,onChange:m=>h(Number(m.target.value))}),A.jsxs("span",{style:{minWidth:"40px",textAlign:"right"},children:[i,"%"]})]}),A.jsx("label",{style:{fontSize:"11px",color:"var(--text-secondary)",marginBottom:"6px",marginTop:"8px",display:"block"},children:"Speed (3D robot animation speed)"}),A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Slow"}),A.jsx("input",{type:"range",min:30,max:200,step:10,value:r,onChange:m=>p(Number(m.target.value))}),A.jsxs("span",{style:{minWidth:"40px",textAlign:"right"},children:[r,"%"]})]})]})]})}function gB({type:n,active:e}){const t=e?"#00e5ff":"#666",i=28;switch(n){case"robot":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("rect",{x:"8",y:"2",width:"8",height:"6",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"7",y:"9",width:"10",height:"8",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"9",y1:"17",x2:"9",y2:"22",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"15",y1:"17",x2:"15",y2:"22",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"5",y1:"12",x2:"7",y2:"12",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"17",y1:"12",x2:"19",y2:"12",stroke:t,strokeWidth:"1.5"})]});case"mech":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("rect",{x:"7",y:"2",width:"10",height:"5",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"5",y:"8",width:"14",height:"9",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"8",y1:"17",x2:"7",y2:"22",stroke:t,strokeWidth:"2"}),A.jsx("line",{x1:"16",y1:"17",x2:"17",y2:"22",stroke:t,strokeWidth:"2"}),A.jsx("line",{x1:"3",y1:"11",x2:"5",y2:"11",stroke:t,strokeWidth:"2"}),A.jsx("line",{x1:"19",y1:"11",x2:"21",y2:"11",stroke:t,strokeWidth:"2"})]});case"drone":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("circle",{cx:"12",cy:"10",r:"4",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"8",y:"12",width:"8",height:"4",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"4",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"16",y1:"13",x2:"20",y2:"13",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"6",stroke:t,strokeWidth:"1.5"}),A.jsx("circle",{cx:"12",cy:"3",r:"1",fill:t})]});case"spider":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("ellipse",{cx:"12",cy:"12",rx:"6",ry:"3",stroke:t,strokeWidth:"1.5"}),A.jsx("circle",{cx:"12",cy:"9",r:"2.5",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"7",y1:"13",x2:"3",y2:"18",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"17",y1:"13",x2:"21",y2:"18",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"8",y1:"14",x2:"5",y2:"20",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"16",y1:"14",x2:"19",y2:"20",stroke:t,strokeWidth:"1.5"})]});case"orb":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("circle",{cx:"12",cy:"11",r:"6",stroke:t,strokeWidth:"1.5"}),A.jsx("circle",{cx:"12",cy:"5",r:"2",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"9",y1:"17",x2:"8",y2:"21",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"15",y1:"17",x2:"16",y2:"21",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"6",y1:"10",x2:"3",y2:"9",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"18",y1:"10",x2:"21",y2:"9",stroke:t,strokeWidth:"1.5"})]});case"tank":return A.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("rect",{x:"7",y:"3",width:"8",height:"5",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"4",y:"9",width:"14",height:"7",rx:"1",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"5",y:"17",width:"5",height:"3",rx:"0.5",stroke:t,strokeWidth:"1.5"}),A.jsx("rect",{x:"14",y:"17",width:"5",height:"3",rx:"0.5",stroke:t,strokeWidth:"1.5"}),A.jsx("line",{x1:"18",y1:"11",x2:"22",y2:"11",stroke:t,strokeWidth:"2"})]});default:return null}}class yB{ctx=null;nodes=null;currentPreset="off";volume=.3;getCtx(){return this.ctx||(this.ctx=new AudioContext),this.ctx.state==="suspended"&&this.ctx.resume().catch(()=>{}),this.ctx}createNoiseBuffer(e){const t=e.sampleRate,i=e.createBuffer(1,t,t),r=i.getChannelData(0);for(let a=0;a<t;a++)r[a]=Math.random()*2-1;return i}createNoiseSource(e){const t=e.createBufferSource();return t.buffer=this.createNoiseBuffer(e),t.loop=!0,t}buildRain(e,t){const i=[],r=[],a=[],l=[],o=this.createNoiseSource(e),u=e.createGain();u.gain.setValueAtTime(.4,e.currentTime);const h=e.createBiquadFilter();h.type="bandpass",h.frequency.setValueAtTime(3e3,e.currentTime),h.Q.setValueAtTime(.5,e.currentTime);const p=e.createBiquadFilter();p.type="highshelf",p.frequency.setValueAtTime(6e3,e.currentTime),p.gain.setValueAtTime(-6,e.currentTime),o.connect(h),h.connect(p),p.connect(u),u.connect(t),o.start(),i.push(o),r.push(u);const f=setInterval(()=>{if(!this.ctx||this.currentPreset!=="rain")return;const m=2e3+Math.random()*3e3,g=e.createOscillator(),_=e.createGain();g.type="sine",g.frequency.setValueAtTime(m,e.currentTime),g.frequency.exponentialRampToValueAtTime(m*.5,e.currentTime+.05),_.gain.setValueAtTime(.06*Math.random(),e.currentTime),_.gain.exponentialRampToValueAtTime(.001,e.currentTime+.06),g.connect(_),_.connect(t),g.start(e.currentTime),g.stop(e.currentTime+.06)},80+Math.random()*120);return a.push(f),{sources:i,gains:r,master:t,intervals:a,timeouts:l}}buildLofi(e,t){const i=[],r=[],a=e.createOscillator();a.type="sine",a.frequency.setValueAtTime(60,e.currentTime);const l=e.createOscillator();l.type="sine",l.frequency.setValueAtTime(.3,e.currentTime);const o=e.createGain();o.gain.setValueAtTime(5,e.currentTime),l.connect(o),o.connect(a.frequency);const u=e.createGain();u.gain.setValueAtTime(.35,e.currentTime),a.connect(u),u.connect(t),a.start(),l.start(),i.push(a,l),r.push(u,o);const h=this.createNoiseSource(e),p=e.createGain();p.gain.setValueAtTime(.08,e.currentTime);const f=e.createBiquadFilter();return f.type="lowpass",f.frequency.setValueAtTime(400,e.currentTime),h.connect(f),f.connect(p),p.connect(t),h.start(),i.push(h),r.push(p),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildServerRoom(e,t){const i=[],r=[],a=this.createNoiseSource(e),l=e.createGain();l.gain.setValueAtTime(.25,e.currentTime);const o=e.createBiquadFilter();o.type="bandpass",o.frequency.setValueAtTime(500,e.currentTime),o.Q.setValueAtTime(.3,e.currentTime),a.connect(o),o.connect(l),l.connect(t),a.start(),i.push(a),r.push(l);const u=e.createOscillator();u.type="triangle",u.frequency.setValueAtTime(120,e.currentTime);const h=e.createOscillator();h.type="sine",h.frequency.setValueAtTime(.1,e.currentTime);const p=e.createGain();p.gain.setValueAtTime(3,e.currentTime),h.connect(p),p.connect(u.frequency);const f=e.createGain();f.gain.setValueAtTime(.15,e.currentTime),u.connect(f),f.connect(t),u.start(),h.start(),i.push(u,h),r.push(f,p);const m=e.createOscillator();m.type="sine",m.frequency.setValueAtTime(8e3,e.currentTime);const g=e.createGain();return g.gain.setValueAtTime(.02,e.currentTime),m.connect(g),g.connect(t),m.start(),i.push(m),r.push(g),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildDeepSpace(e,t){const i=[],r=[],a=e.createOscillator();a.type="sine",a.frequency.setValueAtTime(40,e.currentTime);const l=e.createOscillator();l.type="sine",l.frequency.setValueAtTime(.05,e.currentTime);const o=e.createGain();o.gain.setValueAtTime(8,e.currentTime),l.connect(o),o.connect(a.frequency);const u=e.createGain();u.gain.setValueAtTime(.3,e.currentTime),a.connect(u);const h=e.createConvolver(),p=e.sampleRate*3,f=e.createBuffer(2,p,e.sampleRate);for(let _=0;_<2;_++){const w=f.getChannelData(_);for(let v=0;v<p;v++)w[v]=(Math.random()*2-1)*Math.pow(1-v/p,2.5)}h.buffer=f,u.connect(h),h.connect(t),a.start(),l.start(),i.push(a,l),r.push(u,o);const m=e.createOscillator();m.type="sine",m.frequency.setValueAtTime(80,e.currentTime);const g=e.createGain();return g.gain.setValueAtTime(.08,e.currentTime),m.connect(g),g.connect(h),m.start(),i.push(m),r.push(g),{sources:i,gains:r,master:t,intervals:[],timeouts:[]}}buildCoffeeShop(e,t){const i=[],r=[],a=[],l=[],o=this.createNoiseSource(e),u=e.createGain();u.gain.setValueAtTime(.15,e.currentTime);const h=e.createBiquadFilter();h.type="lowpass",h.frequency.setValueAtTime(1200,e.currentTime);const p=e.createBiquadFilter();p.type="highpass",p.frequency.setValueAtTime(200,e.currentTime),o.connect(p),p.connect(h),h.connect(u),u.connect(t),o.start(),i.push(o),r.push(u);const f=setInterval(()=>{if(!this.ctx||this.currentPreset!=="coffeeShop")return;const m=1500+Math.random()*2e3,g=e.createOscillator(),_=e.createGain();g.type="triangle",g.frequency.setValueAtTime(m,e.currentTime),_.gain.setValueAtTime(.03*Math.random(),e.currentTime),_.gain.exponentialRampToValueAtTime(.001,e.currentTime+.2),g.connect(_),_.connect(t),g.start(e.currentTime),g.stop(e.currentTime+.2)},2e3+Math.random()*4e3);return a.push(f),{sources:i,gains:r,master:t,intervals:a,timeouts:l}}start(e,t){if(this.stop(),e==="off")return;t!==void 0&&(this.volume=Math.max(0,Math.min(1,t)));const i=this.getCtx();this.currentPreset=e;const r=i.createGain();r.gain.setValueAtTime(this.volume,i.currentTime),r.connect(i.destination);const l={rain:(o,u)=>this.buildRain(o,u),lofi:(o,u)=>this.buildLofi(o,u),serverRoom:(o,u)=>this.buildServerRoom(o,u),deepSpace:(o,u)=>this.buildDeepSpace(o,u),coffeeShop:(o,u)=>this.buildCoffeeShop(o,u)}[e];l&&(this.nodes=l(i,r))}stop(){if(this.nodes){for(const e of this.nodes.intervals)clearInterval(e);for(const e of this.nodes.timeouts)clearTimeout(e);for(const e of this.nodes.sources)try{e.stop()}catch{}for(const e of this.nodes.gains)e.disconnect();this.nodes.master.disconnect(),this.nodes=null,this.currentPreset="off"}}setVolume(e){if(this.volume=Math.max(0,Math.min(1,e)),this.nodes){const t=this.getCtx();this.nodes.master.gain.setValueAtTime(this.volume,t.currentTime)}}getVolume(){return this.volume}getCurrentPreset(){return this.currentPreset}isPlaying(){return this.nodes!==null&&this.currentPreset!=="off"}dispose(){this.stop(),this.ctx&&(this.ctx.close().catch(()=>{}),this.ctx=null)}}const Ch=new yB,Kw=[{id:"claude",label:"Claude"},{id:"gemini",label:"Gemini"},{id:"codex",label:"Codex"},{id:"openclaw",label:"OpenClaw"}],_B=vs.getSoundNames(),bB=[{value:"off",label:"Off"},{value:"rain",label:"Rain"},{value:"lofi",label:"Lo-fi Hum"},{value:"serverRoom",label:"Server Room"},{value:"deepSpace",label:"Deep Space"},{value:"coffeeShop",label:"Coffee Shop"}];function vB(){const[n,e]=V.useState("claude"),t=Gt(b=>b.soundSettings.enabled),i=Gt(b=>b.soundSettings.volume),r=Gt(b=>b.updateSoundSettings),a=Gt(b=>b.soundSettings.perCli),l=Gt(b=>b.updateCliSoundConfig),o=Gt(b=>b.setCliActionSound),u=Gt(b=>b.ambientSettings),h=Gt(b=>b.updateAmbientSettings),p=Gt(b=>b.activityFeedVisible),f=Gt(b=>b.setActivityFeedVisible),m=Gt(b=>b.toastEnabled),g=Gt(b=>b.setToastEnabled),_=a[n];function w(b){vs.preview(b)}function v(b){h({preset:b}),b==="off"?Ch.stop():u.enabled&&Ch.start(b,u.volume)}function x(b){h({enabled:b}),b&&u.preset!=="off"?Ch.start(u.preset,u.volume):Ch.stop()}function S(b){h({volume:b}),Ch.setVolume(b)}return A.jsxs("div",{children:[A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Master Sound"}),A.jsxs("div",{className:Ye.soundControls,children:[A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:t,onChange:b=>r({enabled:b.target.checked})}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Enable sound effects"})]}),A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Master Volume"}),A.jsx("input",{type:"range",min:0,max:1,step:.05,value:i,onChange:b=>r({volume:Number(b.target.value)})}),A.jsxs("span",{className:Ye.volumeDisplay,children:[Math.round(i*100),"%"]})]})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Per-CLI Sound Profiles"}),A.jsx("div",{className:Ye.tabs,style:{marginBottom:0,paddingLeft:0},children:Kw.map(b=>A.jsx("button",{className:`${Ye.tab}${n===b.id?` ${Ye.active}`:""}`,onClick:()=>e(b.id),children:b.label},b.id))}),A.jsxs("div",{style:{padding:"12px 0"},children:[A.jsxs("div",{className:Ye.soundControls,style:{marginBottom:12},children:[A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:_.enabled,onChange:b=>l(n,{enabled:b.target.checked})}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsxs("span",{children:["Enable ",Kw.find(b=>b.id===n)?.label," sounds"]})]}),A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Volume"}),A.jsx("input",{type:"range",min:0,max:1,step:.05,value:_.volume,onChange:b=>l(n,{volume:Number(b.target.value)})}),A.jsxs("span",{className:Ye.volumeDisplay,children:[Math.round(_.volume*100),"%"]})]})]}),A.jsx("div",{className:Ye.soundActionGrid,children:SO.map(b=>A.jsxs("div",{children:[A.jsx("div",{className:Ye.soundCategoryLabel,children:b.label}),b.actions.map(C=>{const O=_.actions[C]??"none";return A.jsxs("div",{className:Ye.soundActionRow,children:[A.jsx("span",{className:Ye.soundActionLabel,children:xO[C]}),A.jsx("select",{className:Ye.soundActionSelect,value:O,onChange:M=>o(n,C,M.target.value),children:_B.map(M=>A.jsx("option",{value:M,children:M},M))}),A.jsx("button",{className:Ye.soundPreviewBtn,title:"Preview sound",onClick:()=>w(O),children:"▶"})]},C)})]},b.label))})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Ambient & White Noise"}),A.jsxs("div",{className:Ye.soundControls,children:[A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:u.enabled,onChange:b=>x(b.target.checked)}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Enable ambient sounds"})]}),A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Volume"}),A.jsx("input",{type:"range",min:0,max:1,step:.05,value:u.volume,onChange:b=>S(Number(b.target.value))}),A.jsxs("span",{className:Ye.volumeDisplay,children:[Math.round(u.volume*100),"%"]})]}),A.jsxs("div",{className:Ye.soundActionRow,style:{padding:0},children:[A.jsx("span",{className:Ye.soundActionLabel,children:"Preset"}),A.jsx("select",{className:Ye.soundActionSelect,style:{width:140},value:u.preset,onChange:b=>v(b.target.value),children:bB.map(b=>A.jsx("option",{value:b.value,children:b.label},b.value))})]}),A.jsxs("label",{className:Ye.toggleLabel,style:{marginTop:8},children:[A.jsx("input",{type:"checkbox",checked:u.roomSounds,onChange:b=>h({roomSounds:b.target.checked})}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Room activity sounds"})]}),u.roomSounds&&A.jsxs("div",{className:Ye.volumeControl,children:[A.jsx("span",{children:"Room Volume"}),A.jsx("input",{type:"range",min:0,max:1,step:.05,value:u.roomVolume,onChange:b=>h({roomVolume:Number(b.target.value)})}),A.jsxs("span",{className:Ye.volumeDisplay,children:[Math.round(u.roomVolume*100),"%"]})]})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Notifications"}),A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:p,onChange:b=>f(b.target.checked)}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Show activity feed"})]}),A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:m,onChange:b=>g(b.target.checked)}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Show toast notifications"})]})]})]})}const xB=[{value:"high",label:"High",desc:"All events (full monitoring)"},{value:"medium",label:"Medium",desc:"Balanced (default)"},{value:"low",label:"Low",desc:"Minimal (start/stop only)"}];function SB(){const n=Gt(b=>b.hookDensity),e=Gt(b=>b.setHookDensity),t=Gt(b=>b.autoSendQueue),i=Gt(b=>b.setAutoSendQueue),r=Gt(b=>b.defaultTerminalTheme),a=Gt(b=>b.setDefaultTerminalTheme),[l,o]=V.useState(null),[u,h]=V.useState(n==="off"?"medium":n),[p,f]=V.useState(!1),[m,g]=V.useState(!1),[_,w]=V.useState(null),v=V.useCallback(async()=>{try{const C=await(await fetch("/api/hooks/status")).json();o(C),C.installed&&C.density!=="off"&&C.density!=="custom"&&h(C.density)}catch{o(null)}},[]);V.useEffect(()=>{v()},[v]);async function x(){f(!0),w(null);try{const b=await fetch("/api/hooks/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({density:u})}),C=await b.json();if(!b.ok)throw new Error(C.error||"Install failed");e(u),await v()}catch(b){w(b instanceof Error?b.message:"Install failed")}finally{f(!1)}}async function S(){g(!0),w(null);try{const b=await fetch("/api/hooks/uninstall",{method:"POST"}),C=await b.json();if(!b.ok)throw new Error(C.error||"Uninstall failed");e("off"),await v()}catch(b){w(b instanceof Error?b.message:"Uninstall failed")}finally{g(!1)}}return A.jsxs("div",{children:[A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Hook Density"}),A.jsx("p",{className:Ye.settingsHint,children:"Controls which Claude events are monitored. Higher density provides more detail but slightly increases hook overhead."}),A.jsx("div",{className:Ye.densityControl,children:xB.map(b=>A.jsxs("button",{className:`${Ye.densityBtn}${u===b.value?` ${Ye.active}`:""}`,onClick:()=>h(b.value),children:[A.jsx("span",{className:Ye.densityBtnLabel,children:b.label}),A.jsx("span",{className:Ye.densityBtnDesc,children:b.desc})]},b.value))}),A.jsxs("div",{className:Ye.densityActions,children:[A.jsx("button",{className:Ye.fontBtn,onClick:x,disabled:p,children:p?"Installing...":l?.installed?"Re-install":"Install"}),l?.installed&&A.jsx("button",{className:Ye.fontBtn,onClick:S,disabled:m,children:m?"Removing...":"Uninstall"})]}),A.jsxs("div",{className:Ye.densityStatus,children:[A.jsx("span",{className:`${Ye.hookStatusDot}${l?.installed?` ${Ye.installed}`:""}`}),l?.installed?A.jsxs("span",{children:["Installed: ",A.jsx("strong",{children:l.density})," (",l.events.length," events)"]}):A.jsx("span",{children:"Not installed"})]}),_&&A.jsx("div",{style:{color:"var(--accent-red)",fontSize:"11px",marginTop:"8px"},children:_})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Queue"}),A.jsxs("label",{className:Ye.toggleLabel,children:[A.jsx("input",{type:"checkbox",checked:t,onChange:b=>i(b.target.checked)}),A.jsx("span",{className:Ye.toggleSwitch}),A.jsx("span",{children:"Auto-send queued prompts when session becomes idle"})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Default Terminal Theme"}),A.jsxs("select",{style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"6px 10px",borderRadius:"4px",outline:"none",cursor:"pointer"},value:r,onChange:b=>a(b.target.value),children:[A.jsx("option",{value:"auto",children:"Auto (match dashboard)"}),A.jsx("option",{value:"dark",children:"Dark"}),A.jsx("option",{value:"light",children:"Light"}),A.jsx("option",{value:"solarized-dark",children:"Solarized Dark"}),A.jsx("option",{value:"solarized-light",children:"Solarized Light"}),A.jsx("option",{value:"dracula",children:"Dracula"}),A.jsx("option",{value:"monokai",children:"Monokai"})]})]})]})}function y_({label:n,provider:e,placeholder:t}){const i={anthropic:"anthropicApiKey",openai:"openaiApiKey",gemini:"geminiApiKey"},r=Gt(w=>w[i[e]]),a=Gt(w=>w.setApiKey),[l,o]=V.useState(!1),[u,h]=V.useState(r),[p,f]=V.useState(r?"Key saved in browser":""),[m,g]=V.useState("");function _(){const w=u.trim();a(e,w),w?(f("Saved"),g("var(--accent-green, #4caf50)")):(f("Cleared"),g("var(--text-dim)")),setTimeout(()=>{f(w?"Key saved in browser":""),g("")},2e3)}return A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:n}),A.jsxs("div",{className:Ye.apiKeyRow,children:[A.jsx("input",{type:l?"text":"password",className:Ye.apiKeyInput,placeholder:t,value:u,onChange:w=>h(w.target.value)}),A.jsx("button",{className:Ye.apiKeyToggle,onClick:()=>o(!l),children:l?"HIDE":"SHOW"}),A.jsx("button",{className:Ye.fontBtn,onClick:_,children:"Save"})]}),p&&A.jsx("div",{style:{fontSize:"10px",color:m||"var(--text-dim)",marginTop:"4px"},children:p})]})}function wB(){return A.jsxs("div",{children:[A.jsx("p",{className:Ye.settingsHint,children:"API keys are stored in your browser only (IndexedDB). They are never sent to the server except when explicitly used for summarization or AI features."}),A.jsx(y_,{label:"Anthropic API Key",provider:"anthropic",placeholder:"sk-ant-..."}),A.jsx(y_,{label:"OpenAI API Key",provider:"openai",placeholder:"sk-..."}),A.jsx(y_,{label:"Google (Gemini) API Key",provider:"gemini",placeholder:"AI..."})]})}function CB(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function EB(){const[n,e]=V.useState([]),[t,i]=V.useState(null),[r,a]=V.useState(""),[l,o]=V.useState(""),u=V.useCallback(async()=>{try{const _=await Kt.summaryPrompts.toArray();e(_)}catch{e([])}},[]);V.useEffect(()=>{u()},[u]);async function h(){const _=r.trim(),w=l.trim();if(!_||!w)return;const v=Date.now();if(t!==null){const x=await Kt.summaryPrompts.get(t);x&&await Kt.summaryPrompts.put({...x,name:_,prompt:w,updatedAt:v})}else await Kt.summaryPrompts.add({name:_,prompt:w,isDefault:0,createdAt:v,updatedAt:v});a(""),o(""),i(null),await u()}async function p(_){const w=await Kt.summaryPrompts.toArray();for(const x of w)x.isDefault&&x.id!==_&&await Kt.summaryPrompts.put({...x,isDefault:0,updatedAt:Date.now()});const v=w.find(x=>x.id===_);v&&await Kt.summaryPrompts.put({...v,isDefault:1,updatedAt:Date.now()}),await u()}async function f(_){const w=await Kt.summaryPrompts.get(_);w&&(i(_),a(w.name),o(w.prompt))}async function m(_){await Kt.summaryPrompts.delete(_),await u()}function g(){i(null),a(""),o("")}return A.jsx("div",{children:A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Summary Prompt Templates"}),A.jsx("p",{className:Ye.settingsHint,children:"Manage templates for AI-generated session summaries. Star a template to make it the default."}),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",marginBottom:"14px",maxHeight:"300px",overflowY:"auto"},children:n.length===0?A.jsx("div",{style:{color:"var(--text-dim)",padding:"8px",fontSize:"12px"},children:"No prompt templates"}):n.map(_=>A.jsxs("div",{style:{padding:"8px 12px",border:`1px solid ${_.isDefault?"rgba(0, 229, 255, 0.25)":"var(--border-subtle)"}`,borderRadius:"6px",background:"var(--bg-card)"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[A.jsx("button",{onClick:()=>_.id!=null&&p(_.id),title:_.isDefault?"Default":"Set as default",style:{background:"none",border:"none",color:_.isDefault?"var(--accent-cyan)":"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"0 2px"},children:"★"}),A.jsx("span",{style:{flex:1,fontSize:"12px",fontWeight:500,color:"var(--text-primary)"},children:CB(_.name)}),_.isDefault?A.jsx("span",{style:{fontSize:"9px",padding:"1px 5px",borderRadius:"3px",background:"rgba(0, 229, 255, 0.1)",color:"var(--accent-cyan)",border:"1px solid rgba(0, 229, 255, 0.2)",textTransform:"uppercase"},children:"DEFAULT"}):null,A.jsx("button",{onClick:()=>_.id!=null&&f(_.id),title:"Edit",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",cursor:"pointer",borderRadius:"3px",padding:"1px 5px",fontSize:"12px"},children:"✎"}),A.jsx("button",{onClick:()=>_.id!=null&&m(_.id),title:"Delete",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",cursor:"pointer",borderRadius:"3px",padding:"1px 5px",fontSize:"12px"},children:"×"})]}),A.jsxs("div",{style:{fontSize:"10px",color:"var(--text-dim)",marginTop:"4px",lineHeight:1.3,maxHeight:"28px",overflow:"hidden"},children:[_.prompt.substring(0,120),_.prompt.length>120?"...":""]})]},_.id))}),A.jsxs("div",{style:{marginTop:"10px"},children:[A.jsx("input",{type:"text",placeholder:"Template name",value:r,onChange:_=>a(_.target.value),style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-subtle)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",borderRadius:"6px",padding:"8px 10px",marginBottom:"8px",outline:"none",boxSizing:"border-box"}}),A.jsx("textarea",{placeholder:"Prompt template text...",value:l,onChange:_=>o(_.target.value),rows:4,style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-subtle)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",borderRadius:"6px",padding:"8px 10px",marginBottom:"8px",resize:"vertical",outline:"none",boxSizing:"border-box"}}),A.jsxs("div",{style:{display:"flex",gap:"8px"},children:[A.jsx("button",{className:Ye.fontBtn,onClick:h,children:t!==null?"Update Template":"Add Template"}),t!==null&&A.jsx("button",{className:Ye.fontBtn,onClick:g,children:"Cancel"})]})]})]})})}const kB=[{id:"appearance",label:"APPEARANCE"},{id:"sound",label:"SOUND"},{id:"hooks",label:"HOOKS"},{id:"apikeys",label:"API KEYS"},{id:"advanced",label:"ADVANCED"}];function AB(){const[n,e]=V.useState("appearance"),t=Gt(o=>o.autosaveVisible),i=Gt(o=>o.resetDefaults),r=V.useRef(null);function a(){const o=Gt.getState(),u={},h=new Set(["loadFromDb","saveToDb","updateSoundSettings","updateLabelAlarms","setThemeName","setTheme","setFontSize","setScanlineEnabled","setAnimationIntensity","setAnimationSpeed","setCharacterModel","setHookDensity","setCompactMode","setShowArchived","setGroupBy","setSortBy","setActivityFeedVisible","setToastEnabled","setAutoSendQueue","setDefaultTerminalTheme","setSoundAction","setMovementAction","setApiKey","persistSetting","flashAutosave","resetDefaults","autosaveVisible"]);for(const[g,_]of Object.entries(o))!h.has(g)&&typeof _!="function"&&(u[g]=_);const p=new Blob([JSON.stringify(u,null,2)],{type:"application/json"}),f=URL.createObjectURL(p),m=document.createElement("a");m.href=f,m.download="claude-dashboard-settings.json",m.click(),URL.revokeObjectURL(f)}async function l(o){try{const u=await o.text(),h=JSON.parse(u),p=Gt.getState();p.loadFromDb(h);for(const[f,m]of Object.entries(h))typeof m!="function"&&await p.persistSetting(f,typeof m=="object"?JSON.stringify(m):m)}catch{}}return A.jsx(dm,{modalId:"settings",title:"Settings",children:A.jsxs("div",{className:Ye.panel,children:[A.jsx("div",{className:`${Ye.autosaveIndicator}${t?` ${Ye.visible}`:""}`,style:{marginBottom:"8px"},children:"SAVED"}),A.jsx("div",{className:Ye.tabs,children:kB.map(o=>A.jsx("button",{className:`${Ye.tab}${n===o.id?` ${Ye.active}`:""}`,onClick:()=>e(o.id),children:o.label},o.id))}),A.jsxs("div",{style:{padding:"16px 0",overflowY:"auto",maxHeight:"55vh"},children:[n==="appearance"&&A.jsx(mB,{}),n==="sound"&&A.jsx(vB,{}),n==="hooks"&&A.jsx(SB,{}),n==="apikeys"&&A.jsx(wB,{}),n==="advanced"&&A.jsx(MB,{onExport:a,onImportClick:()=>r.current?.click(),onReset:i})]}),A.jsx("input",{ref:r,type:"file",accept:".json",style:{display:"none"},onChange:o=>{const u=o.target.files?.[0];u&&l(u),o.target.value=""}})]})})}function TB(){const n=bi(e=>e.openModal);return A.jsx("button",{onClick:()=>n("settings"),title:"Settings",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",fontSize:"18px",cursor:"pointer",padding:"4px 10px",borderRadius:"4px",transition:"all 0.2s",marginLeft:"8px"},children:"⚙"})}function MB({onExport:n,onImportClick:e,onReset:t}){return A.jsxs("div",{children:[A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Summary Prompts"}),A.jsx(EB,{})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Import / Export"}),A.jsx("p",{className:Ye.settingsHint,children:"Export all settings to a JSON file, or import settings from a previously exported file."}),A.jsxs("div",{className:Ye.advancedActions,children:[A.jsx("button",{className:Ye.fontBtn,onClick:n,children:"Export Settings"}),A.jsx("button",{className:Ye.fontBtn,onClick:e,children:"Import Settings"})]})]}),A.jsxs("div",{className:Ye.section,children:[A.jsx("h4",{children:"Reset"}),A.jsx("p",{className:Ye.settingsHint,children:"Reset all settings to their default values. This cannot be undone."}),A.jsx("button",{className:Ye.fontBtn,style:{color:"var(--accent-red)",borderColor:"var(--accent-red)"},onClick:t,children:"Reset to Defaults"})]})]})}const RB="_header_19eax_6",OB="_title_19eax_18",NB="_stats_19eax_35",__={header:RB,title:OB,stats:NB};function DB(){return A.jsxs("header",{className:__.header,children:[A.jsx("div",{className:__.title,children:"AI AGENT SESSION CENTER"}),A.jsx("div",{className:__.stats,children:A.jsx(TB,{})})]})}function IB(n,e,t=!0){V.useEffect(()=>{if(!t)return;function i(r){n.current&&!n.current.contains(r.target)&&e()}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,e,t])}const LB=3e3,m0=new Set;function Nt(n,e="info",t=LB){const i={id:`${Date.now()}-${Math.random().toString(36).slice(2,6)}`,message:n,type:e,duration:t};for(const r of m0)r(i)}const BB={info:"var(--accent-cyan, #00e5ff)",success:"var(--accent-green, #00ff88)",error:"var(--accent-red, #ff3355)",warning:"var(--accent-orange, #ff9100)"};function zB(){const[n,e]=V.useState([]),t=V.useCallback(i=>{e(r=>[...r,i])},[]);return V.useEffect(()=>(m0.add(t),()=>{m0.delete(t)}),[t]),V.useEffect(()=>{if(n.length===0)return;const i=n.map(r=>setTimeout(()=>{e(a=>a.filter(l=>l.id!==r.id))},r.duration));return()=>i.forEach(clearTimeout)},[n]),n.length===0?null:A.jsx("div",{className:ht.toastContainer,children:n.map(i=>A.jsx("div",{className:ht.toast,style:{borderColor:BB[i.type]},children:A.jsx("span",{className:ht.toastMsg,children:i.message})},i.id))})}const PB="workdir-history";function Yw(){try{return JSON.parse(localStorage.getItem(PB)||"[]")}catch{return[]}}function FB(n,e){const t=new Set(n),i=[...n];for(const r of e)t.has(r)||(t.add(r),i.push(r));return i}function Ab(){const[n,e]=V.useState(()=>Yw());return V.useEffect(()=>{let t=!1;return fetch("/api/known-projects").then(i=>i.json()).then(i=>{if(t)return;const r=Yw();e(FB(r,i.paths??[]))}).catch(()=>{}),()=>{t=!0}},[]),n}const jB="_wrapper_1lqre_6",UB="_triggerBtn_1lqre_10",HB="_open_1lqre_30",qB="_dropdown_1lqre_37",VB="_dropdownHeader_1lqre_62",WB="_dirItem_1lqre_75",$B="_dirInfo_1lqre_94",GB="_dirName_1lqre_102",KB="_dirPath_1lqre_112",YB="_dirRemove_1lqre_121",XB="_empty_1lqre_146",gs={wrapper:jB,triggerBtn:UB,open:HB,dropdown:qB,dropdownHeader:VB,dirItem:WB,dirInfo:$B,dirName:GB,dirPath:KB,dirRemove:YB,empty:XB},A2="workdir-history",ZB="lastSession";function JB(){try{return JSON.parse(localStorage.getItem(A2)||"[]")}catch{return[]}}function QB(n){localStorage.setItem(A2,JSON.stringify(n))}function e5(){try{return JSON.parse(localStorage.getItem(ZB)||"{}")}catch{return{}}}function Xw(n){const e=n.replace(/\/+$/,"");if(e==="~"||e==="/")return e;const t=e.split("/");return t[t.length-1]||e}function t5(){const[n,e]=V.useState(!1),[t,i]=V.useState([]),r=Ab(),a=V.useRef(null),l=V.useCallback(()=>e(!1),[]);IB(a,l,n),V.useEffect(()=>{if(n){const h=JB(),p=new Set(h),f=[...h];for(const m of r)p.has(m)||(p.add(m),f.push(m));i(f)}},[n,r]),V.useEffect(()=>{if(!n)return;function h(p){p.key==="Escape"&&(p.stopPropagation(),l())}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n,l]);async function o(h){l();const p=e5();try{const m=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:p.host||window.location.hostname||"localhost",port:p.port||void 0,username:p.username||void 0,authMethod:p.authMethod||void 0,privateKeyPath:p.privateKeyPath||void 0,workingDir:h,command:p.command||"claude"})})).json();m.ok?(m.terminalId&&yn.getState().selectSession(m.terminalId),Nt(`Session launched in ${Xw(h)}`,"success")):Nt(m.error||"Failed to launch session","error")}catch{Nt("Network error launching session","error")}}function u(h,p){p.stopPropagation();const f=t.filter(m=>m!==h);i(f),QB(f)}return A.jsxs("div",{className:gs.wrapper,ref:a,children:[A.jsx("button",{className:`${gs.triggerBtn} ${n?gs.open:""}`,onClick:()=>e(h=>!h),title:"Recent working directories",children:"DIRS"}),n&&A.jsxs("div",{className:gs.dropdown,children:[A.jsx("div",{className:gs.dropdownHeader,children:"Recent Directories"}),t.length===0?A.jsx("div",{className:gs.empty,children:"No directory history yet. Launch a session to start recording."}):t.map(h=>A.jsxs("div",{className:gs.dirItem,onClick:()=>o(h),title:`Launch session in ${h}`,children:[A.jsxs("div",{className:gs.dirInfo,children:[A.jsx("span",{className:gs.dirName,children:Xw(h)}),A.jsx("span",{className:gs.dirPath,children:h})]}),A.jsx("button",{className:gs.dirRemove,onClick:p=>u(h,p),title:"Remove from history",children:"x"})]},h))]})]})}const n5="_nav_agtd9_8",i5="_navBtn_agtd9_20",r5="_active_agtd9_28",s5="_spacer_agtd9_30",a5="_actions_agtd9_34",o5="_actionsItems_agtd9_35",l5="_qaBtn_agtd9_45",c5="_terminal_agtd9_54",u5="_quick_agtd9_56",h5="_shortcutsBtn_agtd9_61",ys={nav:n5,navBtn:i5,active:r5,spacer:s5,actions:a5,actionsItems:o5,qaBtn:l5,terminal:c5,quick:u5,shortcutsBtn:h5},d5=[{to:"/",label:"LIVE"},{to:"/history",label:"HISTORY"},{to:"/timeline",label:"TIMELINE"},{to:"/analytics",label:"ANALYTICS"},{to:"/queue",label:"QUEUE"}];function f5(){const n=bi(e=>e.openModal);return A.jsxs("nav",{className:ys.nav,children:[A.jsxs("div",{className:ys.actions,children:[A.jsxs("div",{className:ys.actionsItems,children:[A.jsx("button",{className:`${ys.qaBtn} ${ys.terminal}`,onClick:()=>n("new-session"),children:"+ NEW"}),A.jsx("button",{className:`${ys.qaBtn} ${ys.quick}`,onClick:()=>n("quick-session"),children:"QUICK"}),A.jsx(t5,{})]}),A.jsx("button",{className:ys.shortcutsBtn,onClick:()=>n("shortcuts"),title:"Keyboard shortcuts (?)",children:"?"})]}),A.jsx("div",{className:ys.spacer}),d5.map(e=>A.jsx(LE,{to:e.to,end:e.to==="/",className:({isActive:t})=>`${ys.navBtn} ${t?ys.active:""}`,children:e.label},e.to))]})}const p5="_feed_ffix7_29",m5="_feedHeader_ffix7_36",g5="_feedEntries_ffix7_43",y5="_entry_ffix7_48",_5="_feedTime_ffix7_54",b5="_feedProject_ffix7_55",v5="_feedDetail_ffix7_56",x5="_collapseBtn_ffix7_62",S5="_collapsed_ffix7_69",Hs={feed:p5,feedHeader:m5,feedEntries:g5,entry:y5,feedTime:_5,feedProject:b5,feedDetail:v5,collapseBtn:x5,collapsed:S5};function w5(){const n=yn(l=>l.sessions),e=bi(l=>l.activityFeedOpen),t=bi(l=>l.setActivityFeedOpen),i=yn(l=>l.selectSession),[r]=V.useState(50),a=V.useMemo(()=>{const l=[];for(const o of n.values())for(const u of o.events)l.push({sessionId:o.sessionId,projectName:o.projectName||"Unknown",type:u.type,detail:u.detail,timestamp:u.timestamp});return l.sort((o,u)=>u.timestamp-o.timestamp),l.slice(0,r)},[n,r]);return A.jsxs("div",{className:`${Hs.feed} ${e?"":Hs.collapsed}`,children:[A.jsxs("div",{className:Hs.feedHeader,children:[A.jsxs("span",{children:["ACTIVITY FEED (",a.length,")"]}),A.jsx("button",{className:Hs.collapseBtn,onClick:()=>t(!e),children:e?"▼":"▲"})]}),e&&A.jsxs("div",{className:Hs.feedEntries,children:[a.length===0&&A.jsx("div",{className:Hs.entry,style:{textAlign:"center",color:"var(--text-dim)"},children:"No activity yet"}),a.map((l,o)=>A.jsxs("div",{onClick:()=>i(l.sessionId),className:Hs.entry,style:{cursor:"pointer"},children:[A.jsx("span",{className:Hs.feedTime,children:new Date(l.timestamp).toLocaleTimeString()}),A.jsx("span",{className:Hs.feedProject,children:l.projectName}),A.jsxs("span",{className:Hs.feedDetail,children:["[",l.type,"] ",l.detail]})]},`${l.sessionId}-${l.timestamp}-${o}`))]})]})}const C5="_wrapper_1rshg_1",E5="_inputWrapper_1rshg_5",k5="_input_1rshg_5",A5="_arrowBtn_1rshg_30",T5="_arrowBtnOpen_1rshg_52",M5="_dropdown_1rshg_57",R5="_item_1rshg_84",O5="_itemHighlighted_1rshg_101",N5="_empty_1rshg_107",qs={wrapper:C5,inputWrapper:E5,input:k5,arrowBtn:A5,arrowBtnOpen:T5,dropdown:M5,item:R5,itemHighlighted:O5,empty:N5};function xl({value:n,onChange:e,items:t,placeholder:i,className:r}){const[a,l]=V.useState(!1),[o,u]=V.useState(-1),[h,p]=V.useState(!1),f=V.useRef(null),m=V.useRef(null),g=V.useRef(null);V.useEffect(()=>{if(!a)return;function b(C){f.current&&!f.current.contains(C.target)&&l(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);const _=V.useMemo(()=>{if(h||!n.trim())return t;const b=n.toLowerCase();return t.filter(C=>C.toLowerCase().includes(b))},[t,n,h]);V.useEffect(()=>{u(-1)},[_]),V.useEffect(()=>{o>=0&&m.current&&m.current.children[o]?.scrollIntoView({block:"nearest"})},[o]);function w(b){e(b.target.value),p(!1),a||l(!0)}function v(){a?l(!1):(p(!0),l(!0),g.current?.focus())}function x(b){e(b),l(!1),u(-1)}function S(b){b.key==="ArrowDown"?(b.preventDefault(),a||(p(!0),l(!0)),u(C=>C<_.length-1?C+1:0)):b.key==="ArrowUp"?(b.preventDefault(),a||(p(!0),l(!0)),u(C=>C>0?C-1:_.length-1)):b.key==="Enter"?a&&o>=0&&o<_.length&&(b.preventDefault(),x(_[o])):b.key==="Escape"&&a&&(b.stopPropagation(),l(!1))}return A.jsxs("div",{ref:f,className:`${qs.wrapper} ${r??""}`,children:[A.jsxs("div",{className:qs.inputWrapper,children:[A.jsx("input",{ref:g,value:n,onChange:w,onKeyDown:S,placeholder:i,className:qs.input,role:"combobox","aria-expanded":a,"aria-activedescendant":o>=0?`cb-item-${o}`:void 0,"aria-autocomplete":"list"}),A.jsx("button",{type:"button",className:`${qs.arrowBtn}${a?` ${qs.arrowBtnOpen}`:""}`,onClick:v,tabIndex:-1,"aria-label":"Toggle dropdown",children:"▾"})]}),a&&_.length>0&&A.jsx("ul",{ref:m,className:qs.dropdown,role:"listbox",children:_.map((b,C)=>A.jsx("li",{id:`cb-item-${C}`,role:"option","aria-selected":C===o,className:`${qs.item} ${C===o?qs.itemHighlighted:""}`,onMouseDown:O=>{O.preventDefault(),x(b)},onMouseEnter:()=>u(C),children:b},b))}),a&&_.length===0&&A.jsx("div",{className:qs.dropdown,children:A.jsx("div",{className:qs.empty,children:"No matches"})})]})}const T2="workdir-history",D5=20,M2="lastSession";function I5(){try{return JSON.parse(localStorage.getItem(M2)||"{}")}catch{return{}}}function L5(n){try{localStorage.setItem(M2,JSON.stringify(n))}catch{}}function B5(){try{return JSON.parse(localStorage.getItem(T2)||"[]")}catch{return[]}}function z5(n){if(!n)return;const e=B5().filter(t=>t!==n);e.unshift(n),localStorage.setItem(T2,JSON.stringify(e.slice(0,D5)))}const R2="command-history",P5=20,F5=["claude","claude --resume","claude --continue","claude --model sonnet","claude --model opus","claude --dangerously-skip-permissions","claude --verbose","gemini","codex","aider"];function O2(){try{return JSON.parse(localStorage.getItem(R2)||"[]")}catch{return[]}}function j5(){const n=O2(),e=new Set(n),t=[...n];for(const i of F5)e.has(i)||t.push(i);return t}function U5(n){if(!n)return;const e=O2().filter(t=>t!==n);e.unshift(n),localStorage.setItem(R2,JSON.stringify(e.slice(0,P5)))}function H5(){const n=bi(be=>be.closeModal),[e]=V.useState(()=>I5()),[t,i]=V.useState(e.host||window.location.hostname||""),[r,a]=V.useState(String(e.port||22)),[l,o]=V.useState(e.username||""),[u,h]=V.useState(e.authMethod||"key"),[p,f]=V.useState(e.privateKeyPath||""),[m,g]=V.useState(""),[_,w]=V.useState(e.workingDir||"~"),[v,x]=V.useState(e.command||""),[S,b]=V.useState(""),[C,O]=V.useState(""),[M,D]=V.useState(""),[N,B]=V.useState(!1),[U,Y]=V.useState({}),[K,H]=V.useState([]),J=Ab(),Q=V.useMemo(()=>j5(),[]);V.useEffect(()=>{fetch("/api/ssh-keys").then(be=>be.json()).then(be=>H(be.keys??[])).catch(()=>{})},[]);const Z=be=>()=>Y(Ne=>({...Ne,[be]:!0})),ie=Number(r),ne=Number.isInteger(ie)&&ie>=1&&ie<=65535,P=t.trim().length>0,L=l.trim().length>0,F=_.trim().length>0,$=v.trim().length>0,W=ne&&P&&L&&F&&$;async function ye(){if(Y({host:!0,port:!0,username:!0,workingDir:!0,command:!0}),N||!W)return;B(!0);const be={host:t||window.location.hostname||"localhost",port:ie||22,username:l||"",authMethod:u,privateKeyPath:u==="key"&&p?p:void 0,password:u==="password"&&m?m:void 0,workingDir:_||"~",command:v||void 0,apiKey:S||void 0,sessionTitle:C||void 0,label:M||void 0};try{const le=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(be)})).json();le.ok?(z5(_),v&&U5(v),L5({host:be.host,port:be.port,username:be.username,authMethod:u,privateKeyPath:u==="key"?p:void 0,workingDir:_||"~",command:v||void 0}),le.terminalId&&yn.getState().selectSession(le.terminalId),Nt("Terminal session created","success"),n()):Nt(le.error||"Failed to create terminal","error")}catch{Nt("Network error creating terminal","error")}finally{B(!1)}}return A.jsxs(dm,{modalId:"new-session",title:"New Terminal Session",panelClassName:ht.newSessionPanel,children:[A.jsxs("div",{className:ht.newSessionBody,children:[A.jsxs("div",{className:ht.sshFieldRow,children:[A.jsxs("div",{className:`${ht.sshField} ${ht.sshFieldGrow}`,children:[A.jsxs("label",{children:["Host ",A.jsx("span",{className:ht.sshFieldRequired,children:"*"})]}),A.jsx("input",{value:t,onChange:be=>i(be.target.value),onBlur:Z("host"),placeholder:"hostname / IP / domain",style:U.host&&!P?{borderColor:"#ff5555"}:void 0}),U.host&&!P&&A.jsx("span",{className:ht.sshFieldError,children:"Required"})]}),A.jsxs("div",{className:`${ht.sshField} ${ht.sshFieldSmall}`,children:[A.jsxs("label",{children:["Port ",A.jsx("span",{className:ht.sshFieldRequired,children:"*"})]}),A.jsx("input",{value:r,onChange:be=>a(be.target.value),onBlur:Z("port"),placeholder:"22",style:r&&!ne?{borderColor:"#ff5555"}:void 0}),r&&!ne&&A.jsx("span",{className:ht.sshFieldError,children:"1-65535"})]})]}),A.jsxs("div",{className:ht.sshField,children:[A.jsxs("label",{children:["Username ",A.jsx("span",{className:ht.sshFieldRequired,children:"*"})]}),A.jsx("input",{value:l,onChange:be=>o(be.target.value),onBlur:Z("username"),placeholder:"e.g. root",style:U.username&&!L?{borderColor:"#ff5555"}:void 0}),U.username&&!L&&A.jsx("span",{className:ht.sshFieldError,children:"Required"})]}),A.jsxs("div",{className:ht.sshField,children:[A.jsx("label",{children:"Auth Method"}),A.jsx(xl,{value:u==="key"?"SSH Key":"Password",onChange:be=>h(be==="Password"?"password":"key"),items:["SSH Key","Password"],placeholder:"SSH Key"})]}),u==="key"?A.jsxs("div",{className:ht.sshField,children:[A.jsxs("label",{children:["Private Key Path ",A.jsx("span",{className:ht.sshFieldHint,children:"(optional)"})]}),A.jsx(xl,{value:p,onChange:f,items:K.map(be=>be.path),placeholder:"Default (~/.ssh/id_*)"})]}):A.jsxs("div",{className:ht.sshField,children:[A.jsx("label",{children:"Password"}),A.jsx("input",{type:"password",value:m,onChange:be=>g(be.target.value),placeholder:"SSH password"})]}),A.jsxs("div",{className:ht.sshField,children:[A.jsxs("label",{children:["Working Directory ",A.jsx("span",{className:ht.sshFieldRequired,children:"*"})]}),A.jsx(xl,{value:_,onChange:w,items:J,placeholder:"~"}),U.workingDir&&!F&&A.jsx("span",{className:ht.sshFieldError,children:"Required"})]}),A.jsxs("div",{className:ht.sshField,children:[A.jsxs("label",{children:["Command ",A.jsx("span",{className:ht.sshFieldRequired,children:"*"})," ",A.jsx("span",{className:ht.sshFieldHint,children:"(runs after connect)"})]}),A.jsx(xl,{value:v,onChange:x,items:Q,placeholder:"e.g. claude"}),U.command&&!$&&A.jsx("span",{className:ht.sshFieldError,children:"Required"})]}),A.jsxs("div",{className:ht.sshFieldRow,children:[A.jsxs("div",{className:`${ht.sshField} ${ht.sshFieldGrow}`,children:[A.jsx("label",{children:"Session Title"}),A.jsx("input",{value:C,onChange:be=>O(be.target.value),placeholder:"Optional"})]}),A.jsxs("div",{className:`${ht.sshField} ${ht.sshFieldGrow}`,children:[A.jsx("label",{children:"Label"}),A.jsx(xl,{value:M,onChange:D,items:["ONEOFF","HEAVY","IMPORTANT"],placeholder:"None"})]})]}),A.jsxs("div",{className:ht.sshField,children:[A.jsxs("label",{children:["API Key ",A.jsx("span",{className:ht.sshFieldHint,children:"(override ANTHROPIC_API_KEY)"})]}),A.jsx("input",{type:"password",value:S,onChange:be=>b(be.target.value),placeholder:"Optional"})]})]}),A.jsxs("div",{className:ht.newSessionFooter,children:[A.jsx("button",{type:"button",className:ht.closeBtn,onClick:()=>n(),style:{fontSize:"11px",letterSpacing:"1px"},children:"CANCEL"}),A.jsx("button",{type:"button",onClick:ye,disabled:N||!W,style:{padding:"6px 16px",background:"rgba(0, 229, 255, 0.15)",border:"1px solid var(--accent-cyan)",borderRadius:"4px",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"11px",fontWeight:700,letterSpacing:"1px",cursor:N?"not-allowed":"pointer",opacity:N?.5:1},children:N?"CREATING...":"CREATE"})]})]})}const Zw=["claude","claude --resume","claude --continue","claude --model sonnet","claude --model opus","gemini","codex","aider"],q5="command-history";function V5(){try{const n=JSON.parse(localStorage.getItem(q5)||"[]"),e=new Set(n),t=[...n];for(const i of Zw)e.has(i)||t.push(i);return t}catch{return Zw}}const N2="custom-labels";function W5(){try{return JSON.parse(localStorage.getItem(N2)||"[]")}catch{return[]}}function Jw(n){localStorage.setItem(N2,JSON.stringify(n))}const $5="workdir-history";function G5(){try{return JSON.parse(localStorage.getItem($5)||"[]")}catch{return[]}}const mp=["ONEOFF","HEAVY","IMPORTANT"];function K5(){const n=bi(N=>N.closeModal),[e,t]=V.useState(""),[i,r]=V.useState(""),[a,l]=V.useState(W5),[o,u]=V.useState(""),[h,p]=V.useState(()=>G5()[0]||"~"),[f,m]=V.useState("claude"),[g,_]=V.useState(!1),w=Ab(),v=V.useMemo(()=>V5(),[]),x=h.trim().length>0,S=f.trim().length>0,b=x&&S,C=V.useMemo(()=>[...mp,...a.filter(N=>!mp.includes(N))],[a]);function O(){const N=i.trim().toUpperCase();if(!N||C.includes(N))return;const B=[...a,N];l(B),Jw(B),r(""),t(N)}function M(N){if(mp.includes(N))return;const B=a.filter(U=>U!==N);l(B),Jw(B),e===N&&t("")}async function D(){if(!(g||!b)){_(!0);try{const B=await(await fetch("/api/terminals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:window.location.hostname||"localhost",workingDir:h||"~",command:f||"claude",label:e||void 0,sessionTitle:o.trim()||void 0})})).json();B.ok?(Nt(`Quick session launched${e?` [${e}]`:""}`,"success"),B.terminalId&&yn.getState().selectSession(B.terminalId),n()):Nt(B.error||"Failed to launch session","error")}catch{Nt("Network error launching session","error")}finally{_(!1)}}}return A.jsx(dm,{modalId:"quick-session",children:A.jsxs("div",{className:ht.quickSessionPanel,children:[A.jsx("div",{className:ht.quickSessionHeader,children:A.jsx("h3",{children:"QUICK LAUNCH"})}),A.jsxs("div",{className:ht.quickSessionBody,children:[A.jsx("p",{className:ht.quickSessionHint,children:"Launch a local Claude session with optional label"}),A.jsxs("div",{className:ht.quickLabelChips,children:[C.length===0&&A.jsx("span",{className:ht.quickLabelEmpty,children:"No labels configured"}),C.map(N=>A.jsxs("button",{type:"button",className:`${ht.quickLabelChip} ${e===N?ht.active:""}`,onClick:()=>t(e===N?"":N),children:[A.jsx("span",{className:ht.labelText,children:N}),!mp.includes(N)&&A.jsx("span",{className:ht.labelDelete,onClick:B=>{B.stopPropagation(),M(N)},children:"x"})]},N))]}),A.jsx("div",{className:ht.quickLabelInputRow,children:A.jsx("input",{value:i,onChange:N=>r(N.target.value),onKeyDown:N=>N.key==="Enter"&&O(),placeholder:"Add custom label..."})}),A.jsxs("div",{className:ht.quickWorkdirRow,children:[A.jsxs("label",{children:["Session Title ",A.jsx("span",{style:{opacity:.4,fontWeight:400},children:"(optional)"})]}),A.jsx("input",{value:o,onChange:N=>u(N.target.value),placeholder:"Auto-generated if empty"})]}),A.jsxs("div",{className:ht.quickWorkdirRow,children:[A.jsxs("label",{children:["Working Directory ",A.jsx("span",{style:{color:"var(--accent-cyan)",fontWeight:700},children:"*"})]}),A.jsx(xl,{value:h,onChange:p,items:w,placeholder:"~"})]}),A.jsxs("div",{className:ht.quickWorkdirRow,children:[A.jsxs("label",{children:["Command ",A.jsx("span",{style:{color:"var(--accent-cyan)",fontWeight:700},children:"*"})]}),A.jsx(xl,{value:f,onChange:m,items:v,placeholder:"e.g. claude"})]})]}),A.jsxs("div",{className:ht.quickSessionFooter,children:[A.jsx("button",{type:"button",onClick:()=>n(),style:{padding:"6px 14px",background:"transparent",border:"1px solid var(--border-subtle)",borderRadius:"4px",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"11px",letterSpacing:"1px",cursor:"pointer"},children:"CANCEL"}),A.jsx("button",{type:"button",onClick:D,disabled:g||!b,style:{padding:"6px 16px",background:"rgba(0, 229, 255, 0.15)",border:"1px solid var(--accent-cyan)",borderRadius:"4px",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"11px",fontWeight:700,letterSpacing:"1px",cursor:g||!b?"not-allowed":"pointer",opacity:g||!b?.5:1},children:g?"LAUNCHING...":"LAUNCH"})]})]})})}const Y5=[{section:"Navigation",items:[{key:"/",description:"Focus search"},{key:"Escape",description:"Close modal / deselect session"},{key:"?",description:"Toggle this panel"}]},{section:"Actions",items:[{key:"T",description:"New terminal session"},{key:"S",description:"Toggle settings"},{key:"M",description:"Mute / unmute all"}]},{section:"Terminal",items:[{key:"Alt+Cmd/Ctrl+R",description:"Refresh terminal"},{key:"Alt+F11",description:"Toggle fullscreen"}]},{section:"Selected Session",items:[{key:"K",description:"Kill selected session"},{key:"A",description:"Archive selected session"}]}];function X5(){return A.jsx(dm,{modalId:"shortcuts",children:A.jsxs("div",{className:ht.shortcutsPanel,children:[A.jsx("div",{className:ht.shortcutsHeader,children:A.jsx("h3",{children:"KEYBOARD SHORTCUTS"})}),A.jsx("div",{className:ht.shortcutsBody,children:Y5.map(n=>A.jsxs("div",{className:ht.shortcutsSection,children:[A.jsx("h4",{children:n.section}),A.jsx("div",{className:ht.shortcutList,children:n.items.map(e=>A.jsxs("div",{className:ht.shortcutRow,children:[A.jsx("span",{children:e.description}),A.jsx("kbd",{children:e.key})]},e.key))})]},n.section))})]})})}const Z5="_overlay_sw202_9",J5="_panel_sw202_20",Q5="_resizing_sw202_32",e4="_resizeHandle_sw202_35",t4="_active_sw202_40",n4="_closeBtn_sw202_45",i4="_collapseBtn_sw202_55",r4="_headerCompact_sw202_66",s4="_headerCompactName_sw202_74",a4="_header_sw202_66",o4="_charPreview_sw202_94",l4="_headerText_sw202_97",c4="_headerTop_sw202_98",u4="_headerTitles_sw202_99",h4="_titleRow_sw202_102",d4="_meta_sw202_111",f4="_detailStatusBadge_sw202_112",p4="_detailModel_sw202_113",m4="_detailDuration_sw202_114",g4="_tabs_sw202_119",y4="_tab_sw202_119",_4="_splitToggle_sw202_127",b4="_tabSplit_sw202_142",v4="_splitView_sw202_146",x4="_splitLeft_sw202_152",S4="_splitDivider_sw202_160",w4="_splitRight_sw202_172",C4="_tabContent_sw202_183",E4="_tabEmpty_sw202_187",k4="_convEntry_sw202_191",A4="_convUser_sw202_192",T4="_convRole_sw202_196",M4="_convTime_sw202_201",R4="_convText_sw202_202",O4="_convHeader_sw202_206",N4="_convCopy_sw202_207",D4="_activityEntry_sw202_218",I4="_activityTool_sw202_219",L4="_activityEvent_sw202_220",B4="_activityResponse_sw202_221",z4="_activityTime_sw202_223",P4="_activityBadge_sw202_224",F4="_activityBadgeTool_sw202_225",j4="_activityBadgeEvent_sw202_226",U4="_activityBadgeResponse_sw202_227",H4="_activityDetail_sw202_228",q4="_ctrlBar_sw202_234",V4="_ctrlBtn_sw202_235",W4="_resume_sw202_237",$4="_kill_sw202_240",G4="_archive_sw202_242",K4="_alert_sw202_248",Y4="_summarize_sw202_250",X4="_ctrlSelect_sw202_256",Z4="_notesCompose_sw202_262",J4="_noteTextarea_sw202_263",Q4="_saveNote_sw202_265",e6="_noteEntry_sw202_267",t6="_noteMeta_sw202_268",n6="_noteTime_sw202_269",i6="_noteDelete_sw202_270",r6="_noteText_sw202_263",s6="_summaryText_sw202_275",a6="_prevSessionSection_sw202_278",o6="_prevSessionHeader_sw202_279",l6="_prevSessionToggle_sw202_281",c6="_collapsed_sw202_282",u6="_prevSessionContent_sw202_283",h6="_prevSessionEntry_sw202_285",d6="_terminalWithQueue_sw202_289",f6="_terminalSection_sw202_296",p6="_bottomRow_sw202_302",m6="_bookmarkPortal_sw202_313",We={overlay:Z5,panel:J5,resizing:Q5,resizeHandle:e4,active:t4,closeBtn:n4,collapseBtn:i4,headerCompact:r4,headerCompactName:s4,header:a4,charPreview:o4,headerText:l4,headerTop:c4,headerTitles:u4,titleRow:h4,meta:d4,detailStatusBadge:f4,detailModel:p4,detailDuration:m4,tabs:g4,tab:y4,splitToggle:_4,tabSplit:b4,splitView:v4,splitLeft:x4,splitDivider:S4,splitRight:w4,tabContent:C4,tabEmpty:E4,convEntry:k4,convUser:A4,convRole:T4,convTime:M4,convText:R4,convHeader:O4,convCopy:N4,activityEntry:D4,activityTool:I4,activityEvent:L4,activityResponse:B4,activityTime:z4,activityBadge:P4,activityBadgeTool:F4,activityBadgeEvent:j4,activityBadgeResponse:U4,activityDetail:H4,ctrlBar:q4,ctrlBtn:V4,resume:W4,kill:$4,archive:G4,delete:"_delete_sw202_244",alert:K4,summarize:Y4,ctrlSelect:X4,notesCompose:Z4,noteTextarea:J4,saveNote:Q4,noteEntry:e6,noteMeta:t6,noteTime:n6,noteDelete:i6,noteText:r6,summaryText:s6,prevSessionSection:a6,prevSessionHeader:o6,prevSessionToggle:l6,collapsed:c6,prevSessionContent:u6,prevSessionEntry:h6,terminalWithQueue:d6,terminalSection:f6,bottomRow:p6,bookmarkPortal:m6},Xp="detail-panel-width";function Qw(n,e,t,i){try{if(i){const a=localStorage.getItem(`${Xp}:${i}`);if(a){const l=Number(a);if(Number.isFinite(l))return Math.min(t,Math.max(e,l))}}const r=localStorage.getItem(Xp);if(r){const a=Number(r);if(Number.isFinite(a))return Math.min(t,Math.max(e,a))}}catch{}return n}function g6({children:n,initialWidth:e=400,minWidth:t=280,maxWidth:i=800,side:r="right",className:a,activeTab:l}){const o=V.useRef(null),[u,h]=V.useState(!1),p=V.useRef(Qw(e,t,i,l)),f=V.useRef(l);V.useEffect(()=>{if(l===f.current)return;f.current=l;const g=o.current;if(!g)return;const _=Qw(e,t,i,l);p.current=_,g.style.width=`${_}px`},[l,e,t,i]);const m=V.useCallback(g=>{g.preventDefault();const _=o.current;if(!_)return;h(!0);const w=g.clientX,v=_.getBoundingClientRect().width;function x(b){if(!_)return;const C=r==="right"?w-b.clientX:b.clientX-w,O=Math.min(i,Math.max(t,v+C));_.style.width=`${O}px`}function S(){if(h(!1),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect="",_){const b=_.getBoundingClientRect().width;p.current=b;const C=String(Math.round(b));try{localStorage.setItem(Xp,C),f.current&&localStorage.setItem(`${Xp}:${f.current}`,C)}catch{}}}document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",x),document.addEventListener("mouseup",S)},[t,i,r]);return A.jsxs("div",{ref:o,className:`${We.panel} ${u?We.resizing:""} ${a??""}`,style:{width:`${p.current}px`},children:[A.jsx("div",{onMouseDown:m,className:`${We.resizeHandle} ${u?We.active:""}`,style:{[r==="right"?"left":"right"]:"-3px"}}),n]})}const eC="active-tab",tC="split-terminal-project",Zp="split-ratio",y6=700,_6=[{id:"terminal",label:"TERMINAL"},{id:"conversation",label:"PROMPTS"},{id:"project",label:"PROJECT"},{id:"queue",label:"QUEUE"},{id:"notes",label:"NOTES"},{id:"activity",label:"ACTIVITY"},{id:"summary",label:"SUMMARY"}];function b6(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"1",y:"1",width:"5",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),A.jsx("rect",{x:"8",y:"1",width:"5",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function v6(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),A.jsx("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1.3",strokeDasharray:"2 1.5"})]})}function x6({left:n,right:e,ratioKey:t}){const i=V.useRef(null),r=V.useRef(t);r.current=t;const[a,l]=V.useState(()=>{try{const h=localStorage.getItem(t)??localStorage.getItem(Zp);return h?parseFloat(h):.5}catch{return .5}}),o=V.useRef(a);o.current=a;const u=V.useCallback(h=>{h.preventDefault();const p=i.current;if(!p)return;const f=h.clientX,m=o.current,g=p.offsetWidth,_=v=>{const x=v.clientX-f,S=Math.max(.15,Math.min(.85,m+x/g));l(S)},w=()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",w),document.body.style.cursor="",document.body.style.userSelect="";const v=o.current;try{localStorage.setItem(r.current,String(v)),localStorage.setItem(Zp,String(v))}catch{}};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",_),document.addEventListener("mouseup",w)},[]);return A.jsxs("div",{className:We.splitView,ref:i,children:[A.jsx("div",{className:We.splitLeft,style:{flex:`0 0 ${a*100}%`},children:n}),A.jsx("div",{className:We.splitDivider,onMouseDown:u}),A.jsx("div",{className:We.splitRight,style:{flex:1},children:e})]})}function S6({terminalContent:n,promptsContent:e,notesContent:t,activityContent:i,summaryContent:r,queueContent:a,projectContent:l,onTabChange:o,sessionId:u}){const[h,p]=V.useState(()=>{try{return localStorage.getItem(eC)||"terminal"}catch{return"terminal"}}),[f,m]=V.useState(()=>{try{return localStorage.getItem(tC)==="1"}catch{return!1}}),g=typeof window<"u"&&window.innerWidth>=y6,_=V.useCallback(b=>{p(b);try{localStorage.setItem(eC,b)}catch{}o?.(b)},[o]),w=V.useCallback(()=>{m(b=>{const C=!b;try{localStorage.setItem(tC,C?"1":"0")}catch{}return C})},[]),v=f&&g,x=v&&(h==="terminal"||h==="project")?"split":h,S={terminal:n,conversation:e,project:l,queue:a,notes:t,activity:i,summary:r,split:A.jsx(x6,{left:n,right:l,ratioKey:u?`${Zp}:${u}`:Zp})};return A.jsxs(A.Fragment,{children:[A.jsx("div",{className:We.tabs,children:_6.map(b=>{const C=v&&(b.id==="terminal"||b.id==="project")?h==="terminal"||h==="project":h===b.id;return A.jsxs("button",{className:`${We.tab}${C?` ${We.active}`:""}${v&&(b.id==="terminal"||b.id==="project")?` ${We.tabSplit}`:""}`,onClick:()=>_(b.id),"data-tab":b.id,children:[b.label,b.id==="project"&&g&&A.jsx("span",{className:We.splitToggle,onClick:O=>{O.stopPropagation(),w(),!f&&h!=="terminal"&&h!=="project"&&_("project")},title:f?"Separate tabs":"Merge Terminal + Project",children:f?A.jsx(v6,{}):A.jsx(b6,{})})]},b.id)})}),A.jsx("div",{className:We.tabContent,children:S[x]})]})}function Op(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function w6({prev:n,index:e}){const[t,i]=V.useState(!0),r=[...n.promptHistory||[]].sort((o,u)=>u.timestamp-o.timestamp),a=n.startedAt?Op(n.startedAt):"?",l=n.endedAt?Op(n.endedAt):"?";return A.jsxs("div",{className:`${We.prevSessionSection}${t?` ${We.collapsed}`:""}`,children:[A.jsxs("div",{className:We.prevSessionHeader,onClick:()=>i(o=>!o),children:[A.jsx("span",{className:We.prevSessionToggle,children:"▶"}),"Previous Session #",e+1," (",a," - ",l,") ·"," ",r.length," prompts"]}),!t&&A.jsx("div",{className:We.prevSessionContent,children:r.length>0?r.map((o,u)=>A.jsxs("div",{className:`${We.convEntry} ${We.convUser} ${We.prevSessionEntry}`,children:[A.jsxs("div",{className:We.convHeader,children:[A.jsxs("span",{className:We.convRole,children:["#",r.length-u]}),A.jsx("span",{className:We.convTime,children:Op(o.timestamp)})]}),A.jsx("div",{className:We.convText,children:o.text})]},o.timestamp)):A.jsx("div",{className:We.tabEmpty,children:"No prompts in this session"})})]})}function C6({text:n}){const[e,t]=V.useState(!1),i=V.useCallback(async r=>{r.stopPropagation();try{await navigator.clipboard.writeText(n.trim()),t(!0),setTimeout(()=>t(!1),1500)}catch{}},[n]);return A.jsx("button",{className:We.convCopy,onClick:i,children:e?"COPIED":"COPY"})}function E6({prompts:n,previousSessions:e,searchQuery:t}){const i=[...n].sort((a,l)=>l.timestamp-a.timestamp),r=t?.toLowerCase()||"";return A.jsxs("div",{children:[e&&e.length>0&&[...e].reverse().map((a,l)=>A.jsx(w6,{prev:a,index:l},a.sessionId)),i.length>0?i.map((a,l)=>{const o=r&&a.text.toLowerCase().includes(r);return A.jsxs("div",{className:`${We.convEntry} ${We.convUser}${o?" search-highlight":""}`,children:[A.jsxs("div",{className:We.convHeader,children:[A.jsxs("span",{className:We.convRole,children:["#",i.length-l]}),A.jsx("span",{className:We.convTime,children:Op(a.timestamp)}),A.jsx(C6,{text:a.text})]}),A.jsx("div",{className:We.convText,children:a.text})]},a.timestamp)}):e&&e.length>0?null:A.jsx("div",{className:We.tabEmpty,children:"No prompts yet"})]})}function b_(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function k6({events:n,toolLog:e,responseLog:t,searchQuery:i}){const r=[];for(const l of n)r.push({kind:"event",type:l.type,detail:l.detail,timestamp:l.timestamp});for(const l of e)r.push({kind:"tool",tool:l.tool,input:l.input,timestamp:l.timestamp});for(const l of t)r.push({kind:"response",text:l.text,timestamp:l.timestamp});r.sort((l,o)=>o.timestamp-l.timestamp);const a=i?.toLowerCase()||"";return r.length===0?A.jsx("div",{className:We.tabEmpty,children:"No activity yet"}):A.jsx("div",{children:r.map((l,o)=>{const u=`${l.kind}-${l.timestamp}-${o}`,h=l.kind==="tool"?`${l.tool} ${l.input}`:l.kind==="response"?l.text:`${l.type} ${l.detail}`,p=a&&(h||"").toLowerCase().includes(a);return l.kind==="tool"?A.jsxs("div",{className:`${We.activityEntry} ${We.activityTool}${p?" search-highlight":""}`,children:[A.jsx("span",{className:We.activityTime,children:b_(l.timestamp)}),A.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeTool}`,children:l.tool}),A.jsx("span",{className:We.activityDetail,children:l.input})]},u):l.kind==="response"?A.jsxs("div",{className:`${We.activityEntry} ${We.activityResponse}${p?" search-highlight":""}`,children:[A.jsx("span",{className:We.activityTime,children:b_(l.timestamp)}),A.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeResponse}`,children:"RESPONSE"}),A.jsx("span",{className:We.activityDetail,children:l.text})]},u):A.jsxs("div",{className:`${We.activityEntry} ${We.activityEvent}${p?" search-highlight":""}`,children:[A.jsx("span",{className:We.activityTime,children:b_(l.timestamp)}),A.jsx("span",{className:`${We.activityBadge} ${We.activityBadgeEvent}`,children:l.type}),A.jsx("span",{className:We.activityDetail,children:l.detail})]},u)})})}function A6(n){return new Date(n).toLocaleTimeString("en-US",{hour12:!1})}function T6({sessionId:n}){const[e,t]=V.useState([]),[i,r]=V.useState(""),[a,l]=V.useState(!1),[o,u]=V.useState(!1),h=V.useCallback(async()=>{try{u(!1);const m=await fetch(`/api/db/sessions/${n}/notes`);if(m.ok){const g=await m.json();t(g.notes||[])}else u(!0),Nt("Failed to load notes","error")}catch{u(!0),Nt("Network error loading notes","error")}},[n]);V.useEffect(()=>{h()},[h]);const p=V.useCallback(async()=>{const m=i.trim();if(!(!m||a)){l(!0);try{(await fetch(`/api/db/sessions/${n}/notes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:m})})).ok?(r(""),await h()):Nt("Failed to save note","error")}catch{Nt("Failed to save note","error")}finally{l(!1)}}},[n,i,a,h]),f=V.useCallback(async m=>{try{await fetch(`/api/db/sessions/${n}/notes/${m}`,{method:"DELETE"}),await h()}catch{Nt("Failed to delete note","error")}},[n,h]);return A.jsxs("div",{children:[A.jsxs("div",{className:We.notesCompose,children:[A.jsx("textarea",{className:We.noteTextarea,placeholder:"Add a note...",rows:3,value:i,onChange:m=>r(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&p()}}),A.jsx("button",{className:`${We.ctrlBtn} ${We.saveNote}`,onClick:p,disabled:a||!i.trim(),children:a?"SAVING...":"SAVE NOTE"})]}),e.length>0?e.sort((m,g)=>g.createdAt-m.createdAt).map(m=>A.jsxs("div",{className:We.noteEntry,children:[A.jsxs("div",{className:We.noteMeta,children:[A.jsx("span",{className:We.noteTime,children:A6(m.createdAt)}),A.jsx("button",{className:We.noteDelete,onClick:()=>f(m.id),title:"Delete note",children:"DELETE"})]}),A.jsx("div",{className:We.noteText,children:m.text})]},m.id)):o?A.jsxs("div",{className:We.tabEmpty,children:["Failed to load notes — ",A.jsx("button",{onClick:h,style:{background:"none",border:"none",color:"var(--accent-cyan)",cursor:"pointer",fontFamily:"inherit"},children:"retry"})]}):A.jsx("div",{className:We.tabEmpty,children:"No notes yet"})]})}function M6({summary:n}){return n?A.jsx("div",{className:We.summaryText,children:n.split(`
54
+ `).map((e,t)=>A.jsxs("span",{children:[e,t<n.split(`
55
+ `).length-1&&A.jsx("br",{})]},t))}):A.jsx("div",{className:We.tabEmpty,children:"No summary yet — click SUMMARIZE to generate one with AI"})}const R6="_wrapper_1xzkq_9",O6="_placeholder_1xzkq_13",N6="_reconnectPlaceholderBtn_1xzkq_20",D6="_toolbar_1xzkq_45",I6="_themeSelect_1xzkq_50",L6="_toolbarBtn_1xzkq_57",B6="_reconnectBtn_1xzkq_73",z6="_container_1xzkq_86",P6="_queuePanel_1xzkq_101",F6="_queueToggle_1xzkq_107",j6="_queueToggleArrow_1xzkq_115",U6="_collapsed_1xzkq_116",H6="_queueCount_1xzkq_117",q6="_queueBody_1xzkq_119",V6="_queueCompose_1xzkq_123",W6="_queueTextarea_1xzkq_124",$6="_queueAddBtn_1xzkq_127",G6="_queueList_1xzkq_130",K6="_queueListEmpty_1xzkq_132",Y6="_queueItem_1xzkq_135",X6="_queuePos_1xzkq_140",Z6="_queueText_1xzkq_124",J6="_queueActions_1xzkq_142",Q6="_queueActionBtn_1xzkq_144",ez="_queueSend_1xzkq_146",tz="_queueEdit_1xzkq_148",nz="_queueDelete_1xzkq_150",iz="_queueMove_1xzkq_152",rz="_dragging_1xzkq_158",sz="_queueEditTextarea_1xzkq_164",az="_saving_1xzkq_166",oz="_terminalArea_1xzkq_180",lz="_fullscreenArea_1xzkq_192",cz="_mobileScrollOverlay_1xzkq_203",uz="_mobileScrollBtn_1xzkq_219",hz="_bookmarkActiveBtn_1xzkq_269",dz="_bookmarkBadge_1xzkq_277",fz="_terminalRow_1xzkq_297",pz="_termBookmarkPanel_1xzkq_311",mz="_termBookmarkList_1xzkq_322",gz="_termBookmarkItem_1xzkq_328",yz="_termBookmarkHeader_1xzkq_337",_z="_termBookmarkTitle_1xzkq_346",bz="_termBookmarkClose_1xzkq_355",vz="_termBookmarkEmpty_1xzkq_367",xz="_termBookmarkPreview_1xzkq_378",Sz="_termBookmarkNote_1xzkq_387",wz="_termBookmarkActions_1xzkq_405",Cz="_termBookmarkJumpBtn_1xzkq_410",Ez="_termBookmarkDelBtn_1xzkq_426",kz="_fullscreenOverlay_1xzkq_447",Az="_fullscreenTopbar_1xzkq_448",Tz="_fullscreenTitle_1xzkq_454",Mz="_fullscreenContainer_1xzkq_457",gt={wrapper:R6,placeholder:O6,reconnectPlaceholderBtn:N6,toolbar:D6,themeSelect:I6,toolbarBtn:L6,reconnectBtn:B6,container:z6,queuePanel:P6,queueToggle:F6,queueToggleArrow:j6,collapsed:U6,queueCount:H6,queueBody:q6,queueCompose:V6,queueTextarea:W6,queueAddBtn:$6,queueList:G6,queueListEmpty:K6,queueItem:Y6,queuePos:X6,queueText:Z6,queueActions:J6,queueActionBtn:Q6,queueSend:ez,queueEdit:tz,queueDelete:nz,queueMove:iz,dragging:rz,queueEditTextarea:sz,saving:az,terminalArea:oz,fullscreenArea:lz,mobileScrollOverlay:cz,mobileScrollBtn:uz,bookmarkActiveBtn:hz,bookmarkBadge:dz,terminalRow:fz,termBookmarkPanel:pz,termBookmarkList:mz,termBookmarkItem:gz,termBookmarkHeader:yz,termBookmarkTitle:_z,termBookmarkClose:bz,termBookmarkEmpty:vz,termBookmarkPreview:xz,termBookmarkNote:Sz,termBookmarkActions:wz,termBookmarkJumpBtn:Cz,termBookmarkDelBtn:Ez,fullscreenOverlay:kz,fullscreenTopbar:Az,fullscreenTitle:Tz,fullscreenContainer:Mz};let Rz=Date.now();function Oz(){return Rz++}const Nz=[];function D2({sessionId:n,sessionStatus:e,terminalId:t,onQueueCountChange:i}){const r=bs(ie=>ie.queues.get(n)??Nz),a=bs(ie=>ie.add),l=bs(ie=>ie.remove),o=bs(ie=>ie.reorder),u=bs(ie=>ie.moveToSession),h=yn(ie=>ie.sessions),[p,f]=V.useState(""),[m,g]=V.useState(null),[_,w]=V.useState(""),[v,x]=V.useState(!1),[S,b]=V.useState(null),[C,O]=V.useState(null),M=V.useRef(e);V.useEffect(()=>{g(null),w(""),b(null)},[n]),V.useEffect(()=>{i?.(n,r.length)},[r.length,n,i]);const D=V.useCallback(async ie=>{if(!t)return Nt("No terminal attached","error"),!1;try{return(await fetch(`/api/terminals/${t}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:ie+`
56
+ `})})).ok?!0:(Nt("Failed to send to terminal","error"),!1)}catch{return Nt("Network error sending to terminal","error"),!1}},[t]);V.useEffect(()=>{const ie=M.current;if(M.current=e,ie===e||!(e==="waiting"||e==="input")||r.length===0||!t)return;const P=r[0];D(P.text).then(L=>{L&&(l(n,P.id),Nt("Auto-sent queued prompt","info",2e3))})},[e,r,n,t,l,D]);const N=V.useCallback(()=>{const ie=p.trim();if(!ie)return;const ne={id:Oz(),sessionId:n,text:ie,position:r.length,createdAt:Date.now()};a(n,ne),f("")},[p,n,r.length,a]),B=V.useCallback(ie=>{g(ie.id),w(ie.text)},[]),U=V.useCallback(()=>{if(m===null)return;const ie=_.trim();if(!ie)l(n,m);else{const ne=r.findIndex(P=>P.id===m);if(ne>=0){const P={...r[ne],text:ie},L=[...r];L[ne]=P,bs.getState().reorder(n,L.map(F=>F.id)),bs.getState().setQueue(n,L)}}g(null),w("")},[m,_,r,n,l]),Y=V.useCallback(async ie=>{await D(ie.text)&&l(n,ie.id)},[D,l,n]),K=V.useCallback(ie=>{S!==null&&(u([S],n,ie),b(null),Nt("Prompt moved","info",2e3))},[S,n,u]),H=V.useCallback(ie=>{O(ie)},[]),J=V.useCallback((ie,ne)=>{if(ie.preventDefault(),C===null||C===ne)return;const P=[...r],[L]=P.splice(C,1);P.splice(ne,0,L),P.length===r.length&&(o(n,P.map(F=>F.id)),O(ne))},[C,r,o,n]),Q=V.useCallback(()=>{O(null)},[]),Z=Array.from(h.entries()).filter(([ie])=>ie!==n);return A.jsxs("div",{className:`${gt.queuePanel}${v?` ${gt.collapsed}`:""}`,children:[A.jsxs("button",{className:gt.queueToggle,onClick:()=>x(!v),children:[A.jsx("span",{className:gt.queueToggleArrow,children:"▶"}),"QUEUE"," ",A.jsxs("span",{className:gt.queueCount,children:["(",r.length,")"]})]}),A.jsxs("div",{className:gt.queueBody,children:[A.jsxs("div",{className:gt.queueCompose,children:[A.jsx("textarea",{className:gt.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:p,onChange:ie=>f(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&(ie.metaKey||ie.ctrlKey)&&(ie.preventDefault(),N())}}),A.jsx("button",{className:`${gt.toolbarBtn} ${gt.queueAddBtn}`,onClick:N,disabled:!p.trim(),children:"ADD"})]}),A.jsx("div",{className:gt.queueList,children:r.length===0?A.jsx("div",{className:gt.queueListEmpty,children:"Queue is empty. Add prompts to auto-send when session is waiting."}):r.map((ie,ne)=>A.jsxs("div",{className:`${gt.queueItem}${C===ne?` ${gt.dragging}`:""}`,draggable:!0,onDragStart:()=>H(ne),onDragOver:P=>J(P,ne),onDragEnd:Q,children:[A.jsx("span",{className:gt.queuePos,children:ne+1}),m===ie.id?A.jsx("textarea",{className:gt.queueEditTextarea,value:_,onChange:P=>w(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&(P.preventDefault(),U()),P.key==="Escape"&&(g(null),w(""))},autoFocus:!0,rows:2}):A.jsx("span",{className:gt.queueText,children:ie.text}),A.jsx("div",{className:gt.queueActions,children:m===ie.id?A.jsx("button",{className:`${gt.queueActionBtn} ${gt.queueEdit} ${gt.saving}`,onClick:U,children:"SAVE"}):A.jsxs(A.Fragment,{children:[A.jsx("button",{className:`${gt.queueActionBtn} ${gt.queueSend}`,onClick:()=>Y(ie),title:"Send now",children:"SEND"}),A.jsx("button",{className:`${gt.queueActionBtn} ${gt.queueEdit}`,onClick:()=>B(ie),title:"Edit",children:"EDIT"}),A.jsx("button",{className:`${gt.queueActionBtn} ${gt.queueMove}`,onClick:()=>b(S===ie.id?null:ie.id),title:"Move to another session",children:"MOVE"}),A.jsx("button",{className:`${gt.queueActionBtn} ${gt.queueDelete}`,onClick:()=>l(n,ie.id),title:"Remove",children:"DEL"})]})}),S===ie.id&&A.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto"},children:Z.length===0?A.jsx("div",{style:{padding:"8px",color:"var(--text-dim)",fontSize:"10px",textAlign:"center"},children:"No other sessions"}):Z.map(([P,L])=>A.jsxs("button",{onClick:()=>K(P),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary, #e0e0e0)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:F=>{F.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:F=>{F.target.style.background="transparent"},children:[L.projectName||P.slice(0,8),L.title?` — ${L.title}`:""]},P))})]},ie.id))})]})]})}function Dz(n,e){const t={};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Iz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bz={};function nC(n,e){return(Bz.jsx?Lz:Iz).test(n)}const zz=/[ \t\n\f\r]/g;function Pz(n){return typeof n=="object"?n.type==="text"?iC(n.value):!1:iC(n)}function iC(n){return n.replace(zz,"")===""}class cd{constructor(e,t,i){this.normal=t,this.property=e,i&&(this.space=i)}}cd.prototype.normal={};cd.prototype.property={};cd.prototype.space=void 0;function I2(n,e){const t={},i={};for(const r of n)Object.assign(t,r.property),Object.assign(i,r.normal);return new cd(t,i,e)}function g0(n){return n.toLowerCase()}class br{constructor(e,t){this.attribute=t,this.property=e}}br.prototype.attribute="";br.prototype.booleanish=!1;br.prototype.boolean=!1;br.prototype.commaOrSpaceSeparated=!1;br.prototype.commaSeparated=!1;br.prototype.defined=!1;br.prototype.mustUseProperty=!1;br.prototype.number=!1;br.prototype.overloadedBoolean=!1;br.prototype.property="";br.prototype.spaceSeparated=!1;br.prototype.space=void 0;let Fz=0;const en=Ol(),_i=Ol(),y0=Ol(),Je=Ol(),qn=Ol(),nu=Ol(),Mr=Ol();function Ol(){return 2**++Fz}const _0=Object.freeze(Object.defineProperty({__proto__:null,boolean:en,booleanish:_i,commaOrSpaceSeparated:Mr,commaSeparated:nu,number:Je,overloadedBoolean:y0,spaceSeparated:qn},Symbol.toStringTag,{value:"Module"})),v_=Object.keys(_0);class Tb extends br{constructor(e,t,i,r){let a=-1;if(super(e,t),rC(this,"space",r),typeof i=="number")for(;++a<v_.length;){const l=v_[a];rC(this,v_[a],(i&_0[l])===_0[l])}}}Tb.prototype.defined=!0;function rC(n,e,t){t&&(n[e]=t)}function mu(n){const e={},t={};for(const[i,r]of Object.entries(n.properties)){const a=new Tb(i,n.transform(n.attributes||{},i),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),e[i]=a,t[g0(i)]=i,t[g0(a.attribute)]=i}return new cd(e,t,n.space)}const L2=mu({properties:{ariaActiveDescendant:null,ariaAtomic:_i,ariaAutoComplete:null,ariaBusy:_i,ariaChecked:_i,ariaColCount:Je,ariaColIndex:Je,ariaColSpan:Je,ariaControls:qn,ariaCurrent:null,ariaDescribedBy:qn,ariaDetails:null,ariaDisabled:_i,ariaDropEffect:qn,ariaErrorMessage:null,ariaExpanded:_i,ariaFlowTo:qn,ariaGrabbed:_i,ariaHasPopup:null,ariaHidden:_i,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qn,ariaLevel:Je,ariaLive:null,ariaModal:_i,ariaMultiLine:_i,ariaMultiSelectable:_i,ariaOrientation:null,ariaOwns:qn,ariaPlaceholder:null,ariaPosInSet:Je,ariaPressed:_i,ariaReadOnly:_i,ariaRelevant:null,ariaRequired:_i,ariaRoleDescription:qn,ariaRowCount:Je,ariaRowIndex:Je,ariaRowSpan:Je,ariaSelected:_i,ariaSetSize:Je,ariaSort:null,ariaValueMax:Je,ariaValueMin:Je,ariaValueNow:Je,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function B2(n,e){return e in n?n[e]:e}function z2(n,e){return B2(n,e.toLowerCase())}const jz=mu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nu,acceptCharset:qn,accessKey:qn,action:null,allow:null,allowFullScreen:en,allowPaymentRequest:en,allowUserMedia:en,alt:null,as:null,async:en,autoCapitalize:null,autoComplete:qn,autoFocus:en,autoPlay:en,blocking:qn,capture:null,charSet:null,checked:en,cite:null,className:qn,cols:Je,colSpan:null,content:null,contentEditable:_i,controls:en,controlsList:qn,coords:Je|nu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:en,defer:en,dir:null,dirName:null,disabled:en,download:y0,draggable:_i,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:en,formTarget:null,headers:qn,height:Je,hidden:y0,high:Je,href:null,hrefLang:null,htmlFor:qn,httpEquiv:qn,id:null,imageSizes:null,imageSrcSet:null,inert:en,inputMode:null,integrity:null,is:null,isMap:en,itemId:null,itemProp:qn,itemRef:qn,itemScope:en,itemType:qn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:en,low:Je,manifest:null,max:null,maxLength:Je,media:null,method:null,min:null,minLength:Je,multiple:en,muted:en,name:null,nonce:null,noModule:en,noValidate:en,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:en,optimum:Je,pattern:null,ping:qn,placeholder:null,playsInline:en,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:en,referrerPolicy:null,rel:qn,required:en,reversed:en,rows:Je,rowSpan:Je,sandbox:qn,scope:null,scoped:en,seamless:en,selected:en,shadowRootClonable:en,shadowRootDelegatesFocus:en,shadowRootMode:null,shape:null,size:Je,sizes:null,slot:null,span:Je,spellCheck:_i,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Je,step:null,style:null,tabIndex:Je,target:null,title:null,translate:null,type:null,typeMustMatch:en,useMap:null,value:_i,width:Je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qn,axis:null,background:null,bgColor:null,border:Je,borderColor:null,bottomMargin:Je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:en,declare:en,event:null,face:null,frame:null,frameBorder:null,hSpace:Je,leftMargin:Je,link:null,longDesc:null,lowSrc:null,marginHeight:Je,marginWidth:Je,noResize:en,noHref:en,noShade:en,noWrap:en,object:null,profile:null,prompt:null,rev:null,rightMargin:Je,rules:null,scheme:null,scrolling:_i,standby:null,summary:null,text:null,topMargin:Je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:en,disableRemotePlayback:en,prefix:null,property:null,results:Je,security:null,unselectable:null},space:"html",transform:z2}),Uz=mu({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:Mr,accentHeight:Je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Je,amplitude:Je,arabicForm:null,ascent:Je,attributeName:null,attributeType:null,azimuth:Je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Je,by:null,calcMode:null,capHeight:Je,className:qn,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:Je,diffuseConstant:Je,direction:null,display:null,dur:null,divisor:Je,dominantBaseline:null,download:en,dx:null,dy:null,edgeMode:null,editable:null,elevation:Je,enableBackground:null,end:null,event:null,exponent:Je,externalResourcesRequired:null,fill:null,fillOpacity:Je,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:nu,g2:nu,glyphName:nu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Je,horizOriginX:Je,horizOriginY:Je,id:null,ideographic:Je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Je,k:Je,k1:Je,k2:Je,k3:Je,k4:Je,kernelMatrix:Mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Je,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:Je,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:Je,overlineThickness:Je,paintOrder:null,panose1:null,path:null,pathLength:Je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Je,pointsAtY:Je,pointsAtZ:Je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mr,rev:Mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mr,requiredFeatures:Mr,requiredFonts:Mr,requiredFormats:Mr,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:Je,specularExponent:Je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Je,strikethroughThickness:Je,string:null,stroke:null,strokeDashArray:Mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Je,strokeOpacity:Je,strokeWidth:null,style:null,surfaceScale:Je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mr,tabIndex:Je,tableValues:null,target:null,targetX:Je,targetY:Je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Je,underlineThickness:Je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Je,values:null,vAlphabetic:Je,vMathematical:Je,vectorEffect:null,vHanging:Je,vIdeographic:Je,version:null,vertAdvY:Je,vertOriginX:Je,vertOriginY:Je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:B2}),P2=mu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),F2=mu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:z2}),j2=mu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),Hz={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"},qz=/[A-Z]/g,sC=/-[a-z]/g,Vz=/^data[-\w.:]+$/i;function Wz(n,e){const t=g0(e);let i=e,r=br;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Vz.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(sC,Gz);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!sC.test(a)){let l=a.replace(qz,$z);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}r=Tb}return new r(i,e)}function $z(n){return"-"+n.toLowerCase()}function Gz(n){return n.charAt(1).toUpperCase()}const Kz=I2([L2,jz,P2,F2,j2],"html"),Mb=I2([L2,Uz,P2,F2,j2],"svg");function Yz(n){return n.join(" ").trim()}var Wc={},x_,aC;function Xz(){if(aC)return x_;aC=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
57
+ `,h="/",p="*",f="",m="comment",g="declaration";function _(v,x){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];x=x||{};var S=1,b=1;function C(J){var Q=J.match(e);Q&&(S+=Q.length);var Z=J.lastIndexOf(u);b=~Z?J.length-Z:b+J.length}function O(){var J={line:S,column:b};return function(Q){return Q.position=new M(J),B(),Q}}function M(J){this.start=J,this.end={line:S,column:b},this.source=x.source}M.prototype.content=v;function D(J){var Q=new Error(x.source+":"+S+":"+b+": "+J);if(Q.reason=J,Q.filename=x.source,Q.line=S,Q.column=b,Q.source=v,!x.silent)throw Q}function N(J){var Q=J.exec(v);if(Q){var Z=Q[0];return C(Z),v=v.slice(Z.length),Q}}function B(){N(t)}function U(J){var Q;for(J=J||[];Q=Y();)Q!==!1&&J.push(Q);return J}function Y(){var J=O();if(!(h!=v.charAt(0)||p!=v.charAt(1))){for(var Q=2;f!=v.charAt(Q)&&(p!=v.charAt(Q)||h!=v.charAt(Q+1));)++Q;if(Q+=2,f===v.charAt(Q-1))return D("End of comment missing");var Z=v.slice(2,Q-2);return b+=2,C(Z),v=v.slice(Q),b+=2,J({type:m,comment:Z})}}function K(){var J=O(),Q=N(i);if(Q){if(Y(),!N(r))return D("property missing ':'");var Z=N(a),ie=J({type:g,property:w(Q[0].replace(n,f)),value:Z?w(Z[0].replace(n,f)):f});return N(l),ie}}function H(){var J=[];U(J);for(var Q;Q=K();)Q!==!1&&(J.push(Q),U(J));return J}return B(),H()}function w(v){return v?v.replace(o,f):f}return x_=_,x_}var oC;function Zz(){if(oC)return Wc;oC=1;var n=Wc&&Wc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.default=t;const e=n(Xz());function t(i,r){let a=null;if(!i||typeof i!="string")return a;const l=(0,e.default)(i),o=typeof r=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:p}=u;o?r(h,p,u):p&&(a=a||{},a[h]=p)}),a}return Wc}var Eh={},lC;function Jz(){if(lC)return Eh;lC=1,Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(h){return!h||t.test(h)||n.test(h)},l=function(h,p){return p.toUpperCase()},o=function(h,p){return"".concat(p,"-")},u=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(r,o):h=h.replace(i,o),h.replace(e,l))};return Eh.camelCase=u,Eh}var kh,cC;function Qz(){if(cC)return kh;cC=1;var n=kh&&kh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=n(Zz()),t=Jz();function i(r,a){var l={};return!r||typeof r!="string"||(0,e.default)(r,function(o,u){o&&u&&(l[(0,t.camelCase)(o,a)]=u)}),l}return i.default=i,kh=i,kh}var eP=Qz();const tP=id(eP),U2=H2("end"),Rb=H2("start");function H2(n){return e;function e(t){const i=t&&t.position&&t.position[n]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function nP(n){const e=Rb(n),t=U2(n);if(e&&t)return{start:e,end:t}}function jh(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?uC(n.position):"start"in n||"end"in n?uC(n):"line"in n||"column"in n?b0(n):""}function b0(n){return hC(n&&n.line)+":"+hC(n&&n.column)}function uC(n){return b0(n&&n.start)+"-"+b0(n&&n.end)}function hC(n){return n&&typeof n=="number"?n:1}class Zi extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",a={},l=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof e=="string"?r=e:!a.cause&&e&&(l=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?a.ruleId=i:(a.source=i.slice(0,u),a.ruleId=i.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=jh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zi.prototype.file="";Zi.prototype.name="";Zi.prototype.reason="";Zi.prototype.message="";Zi.prototype.stack="";Zi.prototype.column=void 0;Zi.prototype.line=void 0;Zi.prototype.ancestors=void 0;Zi.prototype.cause=void 0;Zi.prototype.fatal=void 0;Zi.prototype.place=void 0;Zi.prototype.ruleId=void 0;Zi.prototype.source=void 0;const Ob={}.hasOwnProperty,iP=new Map,rP=/[A-Z]/g,sP=new Set(["table","tbody","thead","tfoot","tr"]),aP=new Set(["td","th"]),q2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oP(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=mP(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=pP(t,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Mb:Kz,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=V2(r,n,void 0);return a&&typeof a!="string"?a:r.create(n,r.Fragment,{children:a||void 0},void 0)}function V2(n,e,t){if(e.type==="element")return lP(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return cP(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return hP(n,e,t);if(e.type==="mdxjsEsm")return uP(n,e);if(e.type==="root")return dP(n,e,t);if(e.type==="text")return fP(n,e)}function lP(n,e,t){const i=n.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Mb,n.schema=r),n.ancestors.push(e);const a=$2(n,e.tagName,!1),l=gP(n,e);let o=Db(n,e);return sP.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Pz(u):!0})),W2(n,l,a,e),Nb(l,o),n.ancestors.pop(),n.schema=i,n.create(e,a,l,t)}function cP(n,e){if(e.data&&e.data.estree&&n.evaluater){const i=e.data.estree.body[0];return i.type,n.evaluater.evaluateExpression(i.expression)}ed(n,e.position)}function uP(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);ed(n,e.position)}function hP(n,e,t){const i=n.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=Mb,n.schema=r),n.ancestors.push(e);const a=e.name===null?n.Fragment:$2(n,e.name,!0),l=yP(n,e),o=Db(n,e);return W2(n,l,a,e),Nb(l,o),n.ancestors.pop(),n.schema=i,n.create(e,a,l,t)}function dP(n,e,t){const i={};return Nb(i,Db(n,e)),n.create(e,n.Fragment,i,t)}function fP(n,e){return e.value}function W2(n,e,t,i){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=i)}function Nb(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function pP(n,e,t){return i;function i(r,a,l,o){const h=Array.isArray(l.children)?t:e;return o?h(a,l,o):h(a,l)}}function mP(n,e){return t;function t(i,r,a,l){const o=Array.isArray(a.children),u=Rb(i);return e(r,a,l,o,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function gP(n,e){const t={};let i,r;for(r in e.properties)if(r!=="children"&&Ob.call(e.properties,r)){const a=_P(n,r,e.properties[r]);if(a){const[l,o]=a;n.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&aP.has(e.tagName)?i=o:t[l]=o}}if(i){const a=t.style||(t.style={});a[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function yP(n,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&n.evaluater){const a=i.data.estree.body[0];a.type;const l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,n.evaluater.evaluateExpression(o.argument))}else ed(n,e.position);else{const r=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&n.evaluater){const o=i.value.data.estree.body[0];o.type,a=n.evaluater.evaluateExpression(o.expression)}else ed(n,e.position);else a=i.value===null?!0:i.value;t[r]=a}return t}function Db(n,e){const t=[];let i=-1;const r=n.passKeys?new Map:iP;for(;++i<e.children.length;){const a=e.children[i];let l;if(n.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const h=r.get(u)||0;l=u+"-"+h,r.set(u,h+1)}}const o=V2(n,a,l);o!==void 0&&t.push(o)}return t}function _P(n,e,t){const i=Wz(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?Dz(t):Yz(t)),i.property==="style"){let r=typeof t=="object"?t:bP(n,String(t));return n.stylePropertyNameCase==="css"&&(r=vP(r)),["style",r]}return[n.elementAttributeNameCase==="react"&&i.space?Hz[i.property]||i.property:i.attribute,t]}}function bP(n,e){try{return tP(e,{reactCompat:!0})}catch(t){if(n.ignoreInvalidStyle)return{};const i=t,r=new Zi("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=n.filePath||void 0,r.url=q2+"#cannot-parse-style-attribute",r}}function $2(n,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let a=-1,l;for(;++a<r.length;){const o=nC(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}i=l}else i=nC(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return Ob.call(n.components,r)?n.components[r]:r}if(n.evaluater)return n.evaluater.evaluateExpression(i);ed(n)}function ed(n,e){const t=new Zi("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=q2+"#cannot-handle-mdx-estrees-without-createevaluater",t}function vP(n){const e={};let t;for(t in n)Ob.call(n,t)&&(e[xP(t)]=n[t]);return e}function xP(n){let e=n.replace(rP,SP);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function SP(n){return"-"+n.toLowerCase()}const S_={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"]},wP={};function Ib(n,e){const t=wP,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,r=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return G2(n,i,r)}function G2(n,e,t){if(CP(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return dC(n.children,e,t)}return Array.isArray(n)?dC(n,e,t):""}function dC(n,e,t){const i=[];let r=-1;for(;++r<n.length;)i[r]=G2(n[r],e,t);return i.join("")}function CP(n){return!!(n&&typeof n=="object")}const fC=document.createElement("i");function Lb(n){const e="&"+n+";";fC.innerHTML=e;const t=fC.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function Lr(n,e,t,i){const r=n.length;let a=0,l;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,t=t>0?t:0,i.length<1e4)l=Array.from(i),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);a<i.length;)l=i.slice(a,a+1e4),l.unshift(e,0),n.splice(...l),a+=1e4,e+=1e4}function es(n,e){return n.length>0?(Lr(n,n.length,0,e),n):e}const pC={}.hasOwnProperty;function K2(n){const e={};let t=-1;for(;++t<n.length;)EP(e,n[t]);return e}function EP(n,e){let t;for(t in e){const r=(pC.call(n,t)?n[t]:void 0)||(n[t]={}),a=e[t];let l;if(a)for(l in a){pC.call(r,l)||(r[l]=[]);const o=a[l];kP(r[l],Array.isArray(o)?o:o?[o]:[])}}}function kP(n,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?n:i).push(e[t]);Lr(n,0,0,i)}function Y2(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ss(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=Fo(/[A-Za-z]/),Yi=Fo(/[\dA-Za-z]/),AP=Fo(/[#-'*+\--9=?A-Z^-~]/);function Jp(n){return n!==null&&(n<32||n===127)}const v0=Fo(/\d/),TP=Fo(/[\dA-Fa-f]/),MP=Fo(/[!-/:-@[-`{-~]/);function It(n){return n!==null&&n<-2}function jn(n){return n!==null&&(n<0||n===32)}function cn(n){return n===-2||n===-1||n===32}const xm=Fo(new RegExp("\\p{P}|\\p{S}","u")),Al=Fo(/\s/);function Fo(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function gu(n){const e=[];let t=-1,i=0,r=0;for(;++t<n.length;){const a=n.charCodeAt(t);let l="";if(a===37&&Yi(n.charCodeAt(t+1))&&Yi(n.charCodeAt(t+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const o=n.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),r=1):l="�"}else l=String.fromCharCode(a);l&&(e.push(n.slice(i,t),encodeURIComponent(l)),i=t+r+1,l=""),r&&(t+=r,r=0)}return e.join("")+n.slice(i)}function mn(n,e,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return cn(u)?(n.enter(t),o(u)):e(u)}function o(u){return cn(u)&&a++<r?(n.consume(u),o):(n.exit(t),e(u))}}const RP={tokenize:OP};function OP(n){const e=n.attempt(this.parser.constructs.contentInitial,i,r);let t;return e;function i(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),mn(n,e,"linePrefix")}function r(o){return n.enter("paragraph"),a(o)}function a(o){const u=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(o)}function l(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return It(o)?(n.consume(o),n.exit("chunkText"),a):(n.consume(o),l)}}const NP={tokenize:DP},mC={tokenize:IP};function DP(n){const e=this,t=[];let i=0,r,a,l;return o;function o(b){if(i<t.length){const C=t[i];return e.containerState=C[1],n.attempt(C[0].continuation,u,h)(b)}return h(b)}function u(b){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&S();const C=e.events.length;let O=C,M;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){M=e.events[O][1].end;break}x(i);let D=C;for(;D<e.events.length;)e.events[D][1].end={...M},D++;return Lr(e.events,O+1,0,e.events.slice(C)),e.events.length=D,h(b)}return o(b)}function h(b){if(i===t.length){if(!r)return m(b);if(r.currentConstruct&&r.currentConstruct.concrete)return _(b);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(mC,p,f)(b)}function p(b){return r&&S(),x(i),m(b)}function f(b){return e.parser.lazy[e.now().line]=i!==t.length,l=e.now().offset,_(b)}function m(b){return e.containerState={},n.attempt(mC,g,_)(b)}function g(b){return i++,t.push([e.currentConstruct,e.containerState]),m(b)}function _(b){if(b===null){r&&S(),x(0),n.consume(b);return}return r=r||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),w(b)}function w(b){if(b===null){v(n.exit("chunkFlow"),!0),x(0),n.consume(b);return}return It(b)?(n.consume(b),v(n.exit("chunkFlow")),i=0,e.interrupt=void 0,o):(n.consume(b),w)}function v(b,C){const O=e.sliceStream(b);if(C&&O.push(null),b.previous=a,a&&(a.next=b),a=b,r.defineSkip(b.start),r.write(O),e.parser.lazy[b.start.line]){let M=r.events.length;for(;M--;)if(r.events[M][1].start.offset<l&&(!r.events[M][1].end||r.events[M][1].end.offset>l))return;const D=e.events.length;let N=D,B,U;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){if(B){U=e.events[N][1].end;break}B=!0}for(x(i),M=D;M<e.events.length;)e.events[M][1].end={...U},M++;Lr(e.events,N+1,0,e.events.slice(D)),e.events.length=M}}function x(b){let C=t.length;for(;C-- >b;){const O=t[C];e.containerState=O[1],O[0].exit.call(e,n)}t.length=b}function S(){r.write([null]),a=void 0,r=void 0,e.containerState._closeFlow=void 0}}function IP(n,e,t){return mn(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function au(n){if(n===null||jn(n)||Al(n))return 1;if(xm(n))return 2}function Sm(n,e,t){const i=[];let r=-1;for(;++r<n.length;){const a=n[r].resolveAll;a&&!i.includes(a)&&(e=a(e,t),i.push(a))}return e}const x0={name:"attention",resolveAll:LP,tokenize:BP};function LP(n,e){let t=-1,i,r,a,l,o,u,h,p;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(i=t;i--;)if(n[i][0]==="exit"&&n[i][1].type==="attentionSequence"&&n[i][1]._open&&e.sliceSerialize(n[i][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[i][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[i][1].end.offset-n[i][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;u=n[i][1].end.offset-n[i][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f={...n[i][1].end},m={...n[t][1].start};gC(f,-u),gC(m,u),l={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...n[i][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:m},a={type:u>1?"strongText":"emphasisText",start:{...n[i][1].end},end:{...n[t][1].start}},r={type:u>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},n[i][1].end={...l.start},n[t][1].start={...o.end},h=[],n[i][1].end.offset-n[i][1].start.offset&&(h=es(h,[["enter",n[i][1],e],["exit",n[i][1],e]])),h=es(h,[["enter",r,e],["enter",l,e],["exit",l,e],["enter",a,e]]),h=es(h,Sm(e.parser.constructs.insideSpan.null,n.slice(i+1,t),e)),h=es(h,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",r,e]]),n[t][1].end.offset-n[t][1].start.offset?(p=2,h=es(h,[["enter",n[t][1],e],["exit",n[t][1],e]])):p=0,Lr(n,i-1,t-i+3,h),t=i+h.length-p-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function BP(n,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,r=au(i);let a;return l;function l(u){return a=u,n.enter("attentionSequence"),o(u)}function o(u){if(u===a)return n.consume(u),o;const h=n.exit("attentionSequence"),p=au(u),f=!p||p===2&&r||t.includes(u),m=!r||r===2&&p||t.includes(i);return h._open=!!(a===42?f:f&&(r||!m)),h._close=!!(a===42?m:m&&(p||!f)),e(u)}}function gC(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const zP={name:"autolink",tokenize:PP};function PP(n,e,t){let i=0;return r;function r(g){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),a}function a(g){return ar(g)?(n.consume(g),l):g===64?t(g):h(g)}function l(g){return g===43||g===45||g===46||Yi(g)?(i=1,o(g)):h(g)}function o(g){return g===58?(n.consume(g),i=0,u):(g===43||g===45||g===46||Yi(g))&&i++<32?(n.consume(g),o):(i=0,h(g))}function u(g){return g===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.exit("autolink"),e):g===null||g===32||g===60||Jp(g)?t(g):(n.consume(g),u)}function h(g){return g===64?(n.consume(g),p):AP(g)?(n.consume(g),h):t(g)}function p(g){return Yi(g)?f(g):t(g)}function f(g){return g===46?(n.consume(g),i=0,p):g===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(g),n.exit("autolinkMarker"),n.exit("autolink"),e):m(g)}function m(g){if((g===45||Yi(g))&&i++<63){const _=g===45?m:f;return n.consume(g),_}return t(g)}}const ud={partial:!0,tokenize:FP};function FP(n,e,t){return i;function i(a){return cn(a)?mn(n,r,"linePrefix")(a):r(a)}function r(a){return a===null||It(a)?e(a):t(a)}}const X2={continuation:{tokenize:UP},exit:HP,name:"blockQuote",tokenize:jP};function jP(n,e,t){const i=this;return r;function r(l){if(l===62){const o=i.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),a}return t(l)}function a(l){return cn(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function UP(n,e,t){const i=this;return r;function r(l){return cn(l)?mn(n,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return n.attempt(X2,e,t)(l)}}function HP(n){n.exit("blockQuote")}const Z2={name:"characterEscape",tokenize:qP};function qP(n,e,t){return i;function i(a){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(a),n.exit("escapeMarker"),r}function r(a){return MP(a)?(n.enter("characterEscapeValue"),n.consume(a),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(a)}}const J2={name:"characterReference",tokenize:VP};function VP(n,e,t){const i=this;let r=0,a,l;return o;function o(f){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),u}function u(f){return f===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(f),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),a=31,l=Yi,p(f))}function h(f){return f===88||f===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(f),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),a=6,l=TP,p):(n.enter("characterReferenceValue"),a=7,l=v0,p(f))}function p(f){if(f===59&&r){const m=n.exit("characterReferenceValue");return l===Yi&&!Lb(i.sliceSerialize(m))?t(f):(n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(f)&&r++<a?(n.consume(f),p):t(f)}}const yC={partial:!0,tokenize:$P},_C={concrete:!0,name:"codeFenced",tokenize:WP};function WP(n,e,t){const i=this,r={partial:!0,tokenize:O};let a=0,l=0,o;return u;function u(M){return h(M)}function h(M){const D=i.events[i.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=M,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===o?(l++,n.consume(M),p):l<3?t(M):(n.exit("codeFencedFenceSequence"),cn(M)?mn(n,f,"whitespace")(M):f(M))}function f(M){return M===null||It(M)?(n.exit("codeFencedFence"),i.interrupt?e(M):n.check(yC,w,C)(M)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||It(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),f(M)):cn(M)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),mn(n,g,"whitespace")(M)):M===96&&M===o?t(M):(n.consume(M),m)}function g(M){return M===null||It(M)?f(M):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||It(M)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),f(M)):M===96&&M===o?t(M):(n.consume(M),_)}function w(M){return n.attempt(r,C,v)(M)}function v(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),x}function x(M){return a>0&&cn(M)?mn(n,S,"linePrefix",a+1)(M):S(M)}function S(M){return M===null||It(M)?n.check(yC,w,C)(M):(n.enter("codeFlowValue"),b(M))}function b(M){return M===null||It(M)?(n.exit("codeFlowValue"),S(M)):(n.consume(M),b)}function C(M){return n.exit("codeFenced"),e(M)}function O(M,D,N){let B=0;return U;function U(Q){return M.enter("lineEnding"),M.consume(Q),M.exit("lineEnding"),Y}function Y(Q){return M.enter("codeFencedFence"),cn(Q)?mn(M,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):K(Q)}function K(Q){return Q===o?(M.enter("codeFencedFenceSequence"),H(Q)):N(Q)}function H(Q){return Q===o?(B++,M.consume(Q),H):B>=l?(M.exit("codeFencedFenceSequence"),cn(Q)?mn(M,J,"whitespace")(Q):J(Q)):N(Q)}function J(Q){return Q===null||It(Q)?(M.exit("codeFencedFence"),D(Q)):N(Q)}}}function $P(n,e,t){const i=this;return r;function r(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),a)}function a(l){return i.parser.lazy[i.now().line]?t(l):e(l)}}const w_={name:"codeIndented",tokenize:KP},GP={partial:!0,tokenize:YP};function KP(n,e,t){const i=this;return r;function r(h){return n.enter("codeIndented"),mn(n,a,"linePrefix",5)(h)}function a(h){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):t(h)}function l(h){return h===null?u(h):It(h)?n.attempt(GP,l,u)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||It(h)?(n.exit("codeFlowValue"),l(h)):(n.consume(h),o)}function u(h){return n.exit("codeIndented"),e(h)}}function YP(n,e,t){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?t(l):It(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),r):mn(n,a,"linePrefix",5)(l)}function a(l){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):It(l)?r(l):t(l)}}const XP={name:"codeText",previous:JP,resolve:ZP,tokenize:QP};function ZP(n){let e=n.length-4,t=3,i,r;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(i=t;++i<e;)if(n[i][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(i=t-1,e++;++i<=e;)r===void 0?i!==e&&n[i][1].type!=="lineEnding"&&(r=i):(i===e||n[i][1].type==="lineEnding")&&(n[r][1].type="codeTextData",i!==r+2&&(n[r][1].end=n[i-1][1].end,n.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return n}function JP(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QP(n,e,t){let i=0,r,a;return l;function l(f){return n.enter("codeText"),n.enter("codeTextSequence"),o(f)}function o(f){return f===96?(n.consume(f),i++,o):(n.exit("codeTextSequence"),u(f))}function u(f){return f===null?t(f):f===32?(n.enter("space"),n.consume(f),n.exit("space"),u):f===96?(a=n.enter("codeTextSequence"),r=0,p(f)):It(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):(n.enter("codeTextData"),h(f))}function h(f){return f===null||f===32||f===96||It(f)?(n.exit("codeTextData"),u(f)):(n.consume(f),h)}function p(f){return f===96?(n.consume(f),r++,p):r===i?(n.exit("codeTextSequence"),n.exit("codeText"),e(f)):(a.type="codeTextData",h(f))}}class e8{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const i=t??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,t,i){const r=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Ah(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ah(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ah(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Ah(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ah(this.left,t.reverse())}}}function Ah(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function Q2(n){const e={};let t=-1,i,r,a,l,o,u,h;const p=new e8(n);for(;++t<p.length;){for(;t in e;)t=e[t];if(i=p.get(t),t&&i[1].type==="chunkFlow"&&p.get(t-1)[1].type==="listItemPrefix"&&(u=i[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,t8(p,t)),t=e[t],h=!0);else if(i[1]._container){for(a=t,r=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(p.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...p.get(r)[1].start},o=p.slice(r,t),o.unshift(i),p.splice(r,t-r+1,o))}}return Lr(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function t8(n,e){const t=n.get(e)[1],i=n.get(e)[2];let r=e-1;const a=[];let l=t._tokenizer;l||(l=i.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,u=[],h={};let p,f,m=-1,g=t,_=0,w=0;const v=[w];for(;g;){for(;n.get(++r)[1]!==g;);a.push(r),g._tokenizer||(p=i.sliceStream(g),g.next||p.push(null),f&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=t;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(w=m+1,v.push(w),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):v.pop(),m=v.length;m--;){const x=o.slice(v[m],v[m+1]),S=a.pop();u.push([S,S+x.length-1]),n.splice(S,2,x)}for(u.reverse(),m=-1;++m<u.length;)h[_+u[m][0]]=_+u[m][1],_+=u[m][1]-u[m][0]-1;return h}const n8={resolve:r8,tokenize:s8},i8={partial:!0,tokenize:a8};function r8(n){return Q2(n),n}function s8(n,e){let t;return i;function i(o){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),r(o)}function r(o){return o===null?a(o):It(o)?n.check(i8,l,a)(o):(n.consume(o),r)}function a(o){return n.exit("chunkContent"),n.exit("content"),e(o)}function l(o){return n.consume(o),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,r}}function a8(n,e,t){const i=this;return r;function r(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),mn(n,a,"linePrefix")}function a(l){if(l===null||It(l))return t(l);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(l):n.interrupt(i.parser.constructs.flow,t,e)(l)}}function ek(n,e,t,i,r,a,l,o,u){const h=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(x){return x===60?(n.enter(i),n.enter(r),n.enter(a),n.consume(x),n.exit(a),m):x===null||x===32||x===41||Jp(x)?t(x):(n.enter(i),n.enter(l),n.enter(o),n.enter("chunkString",{contentType:"string"}),w(x))}function m(x){return x===62?(n.enter(a),n.consume(x),n.exit(a),n.exit(r),n.exit(i),e):(n.enter(o),n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===62?(n.exit("chunkString"),n.exit(o),m(x)):x===null||x===60||It(x)?t(x):(n.consume(x),x===92?_:g)}function _(x){return x===60||x===62||x===92?(n.consume(x),g):g(x)}function w(x){return!p&&(x===null||x===41||jn(x))?(n.exit("chunkString"),n.exit(o),n.exit(l),n.exit(i),e(x)):p<h&&x===40?(n.consume(x),p++,w):x===41?(n.consume(x),p--,w):x===null||x===32||x===40||Jp(x)?t(x):(n.consume(x),x===92?v:w)}function v(x){return x===40||x===41||x===92?(n.consume(x),w):w(x)}}function tk(n,e,t,i,r,a){const l=this;let o=0,u;return h;function h(g){return n.enter(i),n.enter(r),n.consume(g),n.exit(r),n.enter(a),p}function p(g){return o>999||g===null||g===91||g===93&&!u||g===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(g):g===93?(n.exit(a),n.enter(r),n.consume(g),n.exit(r),n.exit(i),e):It(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||It(g)||o++>999?(n.exit("chunkString"),p(g)):(n.consume(g),u||(u=!cn(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(n.consume(g),o++,f):f(g)}}function nk(n,e,t,i,r,a){let l;return o;function o(m){return m===34||m===39||m===40?(n.enter(i),n.enter(r),n.consume(m),n.exit(r),l=m===40?41:m,u):t(m)}function u(m){return m===l?(n.enter(r),n.consume(m),n.exit(r),n.exit(i),e):(n.enter(a),h(m))}function h(m){return m===l?(n.exit(a),u(l)):m===null?t(m):It(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),mn(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===l||m===null||It(m)?(n.exit("chunkString"),h(m)):(n.consume(m),m===92?f:p)}function f(m){return m===l||m===92?(n.consume(m),p):p(m)}}function Uh(n,e){let t;return i;function i(r){return It(r)?(n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),t=!0,i):cn(r)?mn(n,i,t?"linePrefix":"lineSuffix")(r):e(r)}}const o8={name:"definition",tokenize:c8},l8={partial:!0,tokenize:u8};function c8(n,e,t){const i=this;let r;return a;function a(g){return n.enter("definition"),l(g)}function l(g){return tk.call(i,n,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return r=Ss(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(n.enter("definitionMarker"),n.consume(g),n.exit("definitionMarker"),u):t(g)}function u(g){return jn(g)?Uh(n,h)(g):h(g)}function h(g){return ek(n,p,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return n.attempt(l8,f,f)(g)}function f(g){return cn(g)?mn(n,m,"whitespace")(g):m(g)}function m(g){return g===null||It(g)?(n.exit("definition"),i.parser.defined.push(r),e(g)):t(g)}}function u8(n,e,t){return i;function i(o){return jn(o)?Uh(n,r)(o):t(o)}function r(o){return nk(n,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return cn(o)?mn(n,l,"whitespace")(o):l(o)}function l(o){return o===null||It(o)?e(o):t(o)}}const h8={name:"hardBreakEscape",tokenize:d8};function d8(n,e,t){return i;function i(a){return n.enter("hardBreakEscape"),n.consume(a),r}function r(a){return It(a)?(n.exit("hardBreakEscape"),e(a)):t(a)}}const f8={name:"headingAtx",resolve:p8,tokenize:m8};function p8(n,e){let t=n.length-2,i=3,r,a;return n[i][1].type==="whitespace"&&(i+=2),t-2>i&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&n[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(r={type:"atxHeadingText",start:n[i][1].start,end:n[t][1].end},a={type:"chunkText",start:n[i][1].start,end:n[t][1].end,contentType:"text"},Lr(n,i,t-i+1,[["enter",r,e],["enter",a,e],["exit",a,e],["exit",r,e]])),n}function m8(n,e,t){let i=0;return r;function r(p){return n.enter("atxHeading"),a(p)}function a(p){return n.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(n.consume(p),l):p===null||jn(p)?(n.exit("atxHeadingSequence"),o(p)):t(p)}function o(p){return p===35?(n.enter("atxHeadingSequence"),u(p)):p===null||It(p)?(n.exit("atxHeading"),e(p)):cn(p)?mn(n,o,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function u(p){return p===35?(n.consume(p),u):(n.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||jn(p)?(n.exit("atxHeadingText"),o(p)):(n.consume(p),h)}}const g8=["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"],bC=["pre","script","style","textarea"],y8={concrete:!0,name:"htmlFlow",resolveTo:v8,tokenize:x8},_8={partial:!0,tokenize:w8},b8={partial:!0,tokenize:S8};function v8(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function x8(n,e,t){const i=this;let r,a,l,o,u;return h;function h(W){return p(W)}function p(W){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(W),f}function f(W){return W===33?(n.consume(W),m):W===47?(n.consume(W),a=!0,w):W===63?(n.consume(W),r=3,i.interrupt?e:L):ar(W)?(n.consume(W),l=String.fromCharCode(W),v):t(W)}function m(W){return W===45?(n.consume(W),r=2,g):W===91?(n.consume(W),r=5,o=0,_):ar(W)?(n.consume(W),r=4,i.interrupt?e:L):t(W)}function g(W){return W===45?(n.consume(W),i.interrupt?e:L):t(W)}function _(W){const ye="CDATA[";return W===ye.charCodeAt(o++)?(n.consume(W),o===ye.length?i.interrupt?e:K:_):t(W)}function w(W){return ar(W)?(n.consume(W),l=String.fromCharCode(W),v):t(W)}function v(W){if(W===null||W===47||W===62||jn(W)){const ye=W===47,be=l.toLowerCase();return!ye&&!a&&bC.includes(be)?(r=1,i.interrupt?e(W):K(W)):g8.includes(l.toLowerCase())?(r=6,ye?(n.consume(W),x):i.interrupt?e(W):K(W)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(W):a?S(W):b(W))}return W===45||Yi(W)?(n.consume(W),l+=String.fromCharCode(W),v):t(W)}function x(W){return W===62?(n.consume(W),i.interrupt?e:K):t(W)}function S(W){return cn(W)?(n.consume(W),S):U(W)}function b(W){return W===47?(n.consume(W),U):W===58||W===95||ar(W)?(n.consume(W),C):cn(W)?(n.consume(W),b):U(W)}function C(W){return W===45||W===46||W===58||W===95||Yi(W)?(n.consume(W),C):O(W)}function O(W){return W===61?(n.consume(W),M):cn(W)?(n.consume(W),O):b(W)}function M(W){return W===null||W===60||W===61||W===62||W===96?t(W):W===34||W===39?(n.consume(W),u=W,D):cn(W)?(n.consume(W),M):N(W)}function D(W){return W===u?(n.consume(W),u=null,B):W===null||It(W)?t(W):(n.consume(W),D)}function N(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||jn(W)?O(W):(n.consume(W),N)}function B(W){return W===47||W===62||cn(W)?b(W):t(W)}function U(W){return W===62?(n.consume(W),Y):t(W)}function Y(W){return W===null||It(W)?K(W):cn(W)?(n.consume(W),Y):t(W)}function K(W){return W===45&&r===2?(n.consume(W),Z):W===60&&r===1?(n.consume(W),ie):W===62&&r===4?(n.consume(W),F):W===63&&r===3?(n.consume(W),L):W===93&&r===5?(n.consume(W),P):It(W)&&(r===6||r===7)?(n.exit("htmlFlowData"),n.check(_8,$,H)(W)):W===null||It(W)?(n.exit("htmlFlowData"),H(W)):(n.consume(W),K)}function H(W){return n.check(b8,J,$)(W)}function J(W){return n.enter("lineEnding"),n.consume(W),n.exit("lineEnding"),Q}function Q(W){return W===null||It(W)?H(W):(n.enter("htmlFlowData"),K(W))}function Z(W){return W===45?(n.consume(W),L):K(W)}function ie(W){return W===47?(n.consume(W),l="",ne):K(W)}function ne(W){if(W===62){const ye=l.toLowerCase();return bC.includes(ye)?(n.consume(W),F):K(W)}return ar(W)&&l.length<8?(n.consume(W),l+=String.fromCharCode(W),ne):K(W)}function P(W){return W===93?(n.consume(W),L):K(W)}function L(W){return W===62?(n.consume(W),F):W===45&&r===2?(n.consume(W),L):K(W)}function F(W){return W===null||It(W)?(n.exit("htmlFlowData"),$(W)):(n.consume(W),F)}function $(W){return n.exit("htmlFlow"),e(W)}}function S8(n,e,t){const i=this;return r;function r(l){return It(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),a):t(l)}function a(l){return i.parser.lazy[i.now().line]?t(l):e(l)}}function w8(n,e,t){return i;function i(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),n.attempt(ud,e,t)}}const C8={name:"htmlText",tokenize:E8};function E8(n,e,t){const i=this;let r,a,l;return o;function o(L){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(L),u}function u(L){return L===33?(n.consume(L),h):L===47?(n.consume(L),O):L===63?(n.consume(L),b):ar(L)?(n.consume(L),N):t(L)}function h(L){return L===45?(n.consume(L),p):L===91?(n.consume(L),a=0,_):ar(L)?(n.consume(L),S):t(L)}function p(L){return L===45?(n.consume(L),g):t(L)}function f(L){return L===null?t(L):L===45?(n.consume(L),m):It(L)?(l=f,ie(L)):(n.consume(L),f)}function m(L){return L===45?(n.consume(L),g):f(L)}function g(L){return L===62?Z(L):L===45?m(L):f(L)}function _(L){const F="CDATA[";return L===F.charCodeAt(a++)?(n.consume(L),a===F.length?w:_):t(L)}function w(L){return L===null?t(L):L===93?(n.consume(L),v):It(L)?(l=w,ie(L)):(n.consume(L),w)}function v(L){return L===93?(n.consume(L),x):w(L)}function x(L){return L===62?Z(L):L===93?(n.consume(L),x):w(L)}function S(L){return L===null||L===62?Z(L):It(L)?(l=S,ie(L)):(n.consume(L),S)}function b(L){return L===null?t(L):L===63?(n.consume(L),C):It(L)?(l=b,ie(L)):(n.consume(L),b)}function C(L){return L===62?Z(L):b(L)}function O(L){return ar(L)?(n.consume(L),M):t(L)}function M(L){return L===45||Yi(L)?(n.consume(L),M):D(L)}function D(L){return It(L)?(l=D,ie(L)):cn(L)?(n.consume(L),D):Z(L)}function N(L){return L===45||Yi(L)?(n.consume(L),N):L===47||L===62||jn(L)?B(L):t(L)}function B(L){return L===47?(n.consume(L),Z):L===58||L===95||ar(L)?(n.consume(L),U):It(L)?(l=B,ie(L)):cn(L)?(n.consume(L),B):Z(L)}function U(L){return L===45||L===46||L===58||L===95||Yi(L)?(n.consume(L),U):Y(L)}function Y(L){return L===61?(n.consume(L),K):It(L)?(l=Y,ie(L)):cn(L)?(n.consume(L),Y):B(L)}function K(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(n.consume(L),r=L,H):It(L)?(l=K,ie(L)):cn(L)?(n.consume(L),K):(n.consume(L),J)}function H(L){return L===r?(n.consume(L),r=void 0,Q):L===null?t(L):It(L)?(l=H,ie(L)):(n.consume(L),H)}function J(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||jn(L)?B(L):(n.consume(L),J)}function Q(L){return L===47||L===62||jn(L)?B(L):t(L)}function Z(L){return L===62?(n.consume(L),n.exit("htmlTextData"),n.exit("htmlText"),e):t(L)}function ie(L){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(L),n.exit("lineEnding"),ne}function ne(L){return cn(L)?mn(n,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return n.enter("htmlTextData"),l(L)}}const Bb={name:"labelEnd",resolveAll:M8,resolveTo:R8,tokenize:O8},k8={tokenize:N8},A8={tokenize:D8},T8={tokenize:I8};function M8(n){let e=-1;const t=[];for(;++e<n.length;){const i=n[e][1];if(t.push(n[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return n.length!==t.length&&Lr(n,0,n.length,t),n}function R8(n,e){let t=n.length,i=0,r,a,l,o;for(;t--;)if(r=n[t][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;n[t][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=t,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=t);const u={type:n[a][1].type==="labelLink"?"link":"image",start:{...n[a][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[a][1].start},end:{...n[l][1].end}},p={type:"labelText",start:{...n[a+i+2][1].end},end:{...n[l-2][1].start}};return o=[["enter",u,e],["enter",h,e]],o=es(o,n.slice(a+1,a+i+3)),o=es(o,[["enter",p,e]]),o=es(o,Sm(e.parser.constructs.insideSpan.null,n.slice(a+i+4,l-3),e)),o=es(o,[["exit",p,e],n[l-2],n[l-1],["exit",h,e]]),o=es(o,n.slice(l+1)),o=es(o,[["exit",u,e]]),Lr(n,a,n.length,o),n}function O8(n,e,t){const i=this;let r=i.events.length,a,l;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){a=i.events[r][1];break}return o;function o(m){return a?a._inactive?f(m):(l=i.parser.defined.includes(Ss(i.sliceSerialize({start:a.end,end:i.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),n.exit("labelEnd"),u):t(m)}function u(m){return m===40?n.attempt(k8,p,l?p:f)(m):m===91?n.attempt(A8,p,l?h:f)(m):l?p(m):f(m)}function h(m){return n.attempt(T8,p,f)(m)}function p(m){return e(m)}function f(m){return a._balanced=!0,t(m)}}function N8(n,e,t){return i;function i(f){return n.enter("resource"),n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),r}function r(f){return jn(f)?Uh(n,a)(f):a(f)}function a(f){return f===41?p(f):ek(n,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return jn(f)?Uh(n,u)(f):p(f)}function o(f){return t(f)}function u(f){return f===34||f===39||f===40?nk(n,h,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):p(f)}function h(f){return jn(f)?Uh(n,p)(f):p(f)}function p(f){return f===41?(n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),n.exit("resource"),e):t(f)}}function D8(n,e,t){const i=this;return r;function r(o){return tk.call(i,n,a,l,"reference","referenceMarker","referenceString")(o)}function a(o){return i.parser.defined.includes(Ss(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):t(o)}function l(o){return t(o)}}function I8(n,e,t){return i;function i(a){return n.enter("reference"),n.enter("referenceMarker"),n.consume(a),n.exit("referenceMarker"),r}function r(a){return a===93?(n.enter("referenceMarker"),n.consume(a),n.exit("referenceMarker"),n.exit("reference"),e):t(a)}}const L8={name:"labelStartImage",resolveAll:Bb.resolveAll,tokenize:B8};function B8(n,e,t){const i=this;return r;function r(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),a}function a(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),l):t(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(o):e(o)}}const z8={name:"labelStartLink",resolveAll:Bb.resolveAll,tokenize:P8};function P8(n,e,t){const i=this;return r;function r(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(l):e(l)}}const C_={name:"lineEnding",tokenize:F8};function F8(n,e){return t;function t(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),mn(n,e,"linePrefix")}}const Np={name:"thematicBreak",tokenize:j8};function j8(n,e,t){let i=0,r;return a;function a(h){return n.enter("thematicBreak"),l(h)}function l(h){return r=h,o(h)}function o(h){return h===r?(n.enter("thematicBreakSequence"),u(h)):i>=3&&(h===null||It(h))?(n.exit("thematicBreak"),e(h)):t(h)}function u(h){return h===r?(n.consume(h),i++,u):(n.exit("thematicBreakSequence"),cn(h)?mn(n,o,"whitespace")(h):o(h))}}const _r={continuation:{tokenize:V8},exit:$8,name:"list",tokenize:q8},U8={partial:!0,tokenize:G8},H8={partial:!0,tokenize:W8};function q8(n,e,t){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return o;function o(g){const _=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:v0(g)){if(i.containerState.type||(i.containerState.type=_,n.enter(_,{_container:!0})),_==="listUnordered")return n.enter("listItemPrefix"),g===42||g===45?n.check(Np,t,h)(g):h(g);if(!i.interrupt||g===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(g)}return t(g)}function u(g){return v0(g)&&++l<10?(n.consume(g),u):(!i.interrupt||l<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(n.exit("listItemValue"),h(g)):t(g)}function h(g){return n.enter("listItemMarker"),n.consume(g),n.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,n.check(ud,i.interrupt?t:p,n.attempt(U8,m,f))}function p(g){return i.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return cn(g)?(n.enter("listItemPrefixWhitespace"),n.consume(g),n.exit("listItemPrefixWhitespace"),m):t(g)}function m(g){return i.containerState.size=a+i.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(g)}}function V8(n,e,t){const i=this;return i.containerState._closeFlow=void 0,n.check(ud,r,a);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,mn(n,e,"listItemIndent",i.containerState.size+1)(o)}function a(o){return i.containerState.furtherBlankLines||!cn(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,n.attempt(H8,e,l)(o))}function l(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,mn(n,n.attempt(_r,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function W8(n,e,t){const i=this;return mn(n,r,"listItemIndent",i.containerState.size+1);function r(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?e(a):t(a)}}function $8(n){n.exit(this.containerState.type)}function G8(n,e,t){const i=this;return mn(n,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const l=i.events[i.events.length-1];return!cn(a)&&l&&l[1].type==="listItemPrefixWhitespace"?e(a):t(a)}}const vC={name:"setextUnderline",resolveTo:K8,tokenize:Y8};function K8(n,e){let t=n.length,i,r,a;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){i=t;break}n[t][1].type==="paragraph"&&(r=t)}else n[t][1].type==="content"&&n.splice(t,1),!a&&n[t][1].type==="definition"&&(a=t);const l={type:"setextHeading",start:{...n[i][1].start},end:{...n[n.length-1][1].end}};return n[r][1].type="setextHeadingText",a?(n.splice(r,0,["enter",l,e]),n.splice(a+1,0,["exit",n[i][1],e]),n[i][1].end={...n[a][1].end}):n[i][1]=l,n.push(["exit",l,e]),n}function Y8(n,e,t){const i=this;let r;return a;function a(h){let p=i.events.length,f;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){f=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(n.enter("setextHeadingLine"),r=h,l(h)):t(h)}function l(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===r?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),cn(h)?mn(n,u,"lineSuffix")(h):u(h))}function u(h){return h===null||It(h)?(n.exit("setextHeadingLine"),e(h)):t(h)}}const X8={tokenize:Z8};function Z8(n){const e=this,t=n.attempt(ud,i,n.attempt(this.parser.constructs.flowInitial,r,mn(n,n.attempt(this.parser.constructs.flow,r,n.attempt(n8,r)),"linePrefix")));return t;function i(a){if(a===null){n.consume(a);return}return n.enter("lineEndingBlank"),n.consume(a),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function r(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const J8={resolveAll:rk()},Q8=ik("string"),eF=ik("text");function ik(n){return{resolveAll:rk(n==="text"?tF:void 0),tokenize:e};function e(t){const i=this,r=this.parser.constructs[n],a=t.attempt(r,l,o);return l;function l(p){return h(p)?a(p):o(p)}function o(p){if(p===null){t.consume(p);return}return t.enter("data"),t.consume(p),u}function u(p){return h(p)?(t.exit("data"),a(p)):(t.consume(p),u)}function h(p){if(p===null)return!0;const f=r[p];let m=-1;if(f)for(;++m<f.length;){const g=f[m];if(!g.previous||g.previous.call(i,i.previous))return!0}return!1}}}function rk(n){return e;function e(t,i){let r=-1,a;for(;++r<=t.length;)a===void 0?t[r]&&t[r][1].type==="data"&&(a=r,r++):(!t[r]||t[r][1].type!=="data")&&(r!==a+2&&(t[a][1].end=t[r-1][1].end,t.splice(a+2,r-a-2),r=a+2),a=void 0);return n?n(t,i):t}}function tF(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const i=n[t-1][1],r=e.sliceStream(i);let a=r.length,l=-1,o=0,u;for(;a--;){const h=r[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(h===-2)u=!0,o++;else if(h!==-1){a++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(o=0),o){const h={type:t===n.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(n.splice(t,0,["enter",h,e],["exit",h,e]),t+=2)}t++}return n}const nF={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:X2},iF={91:o8},rF={[-2]:w_,[-1]:w_,32:w_},sF={35:f8,42:Np,45:[vC,Np],60:y8,61:vC,95:Np,96:_C,126:_C},aF={38:J2,92:Z2},oF={[-5]:C_,[-4]:C_,[-3]:C_,33:L8,38:J2,42:x0,60:[zP,C8],91:z8,92:[h8,Z2],93:Bb,95:x0,96:XP},lF={null:[x0,J8]},cF={null:[42,95]},uF={null:[]},hF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cF,contentInitial:iF,disable:uF,document:nF,flow:sF,flowInitial:rF,insideSpan:lF,string:aF,text:oF},Symbol.toStringTag,{value:"Module"}));function dF(n,e,t){let i={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const r={},a=[];let l=[],o=[];const u={attempt:D(O),check:D(M),consume:S,enter:b,exit:C,interrupt:D(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:_,parser:n,previous:null,sliceSerialize:m,sliceStream:g,write:f};let p=e.tokenize.call(h,u);return e.resolveAll&&a.push(e),h;function f(Y){return l=es(l,Y),v(),l[l.length-1]!==null?[]:(N(e,0),h.events=Sm(a,h.events,h),h.events)}function m(Y,K){return pF(g(Y),K)}function g(Y){return fF(l,Y)}function _(){const{_bufferIndex:Y,_index:K,line:H,column:J,offset:Q}=i;return{_bufferIndex:Y,_index:K,line:H,column:J,offset:Q}}function w(Y){r[Y.line]=Y.column,U()}function v(){let Y;for(;i._index<l.length;){const K=l[i._index];if(typeof K=="string")for(Y=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===Y&&i._bufferIndex<K.length;)x(K.charCodeAt(i._bufferIndex));else x(K)}}function x(Y){p=p(Y)}function S(Y){It(Y)?(i.line++,i.column=1,i.offset+=Y===-3?2:1,U()):Y!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=Y}function b(Y,K){const H=K||{};return H.type=Y,H.start=_(),h.events.push(["enter",H,h]),o.push(H),H}function C(Y){const K=o.pop();return K.end=_(),h.events.push(["exit",K,h]),K}function O(Y,K){N(Y,K.from)}function M(Y,K){K.restore()}function D(Y,K){return H;function H(J,Q,Z){let ie,ne,P,L;return Array.isArray(J)?$(J):"tokenize"in J?$([J]):F(J);function F(Ne){return le;function le(ee){const Ce=ee!==null&&Ne[ee],xe=ee!==null&&Ne.null,Ze=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(xe)?xe:xe?[xe]:[]];return $(Ze)(ee)}}function $(Ne){return ie=Ne,ne=0,Ne.length===0?Z:W(Ne[ne])}function W(Ne){return le;function le(ee){return L=B(),P=Ne,Ne.partial||(h.currentConstruct=Ne),Ne.name&&h.parser.constructs.disable.null.includes(Ne.name)?be():Ne.tokenize.call(K?Object.assign(Object.create(h),K):h,u,ye,be)(ee)}}function ye(Ne){return Y(P,L),Q}function be(Ne){return L.restore(),++ne<ie.length?W(ie[ne]):Z}}}function N(Y,K){Y.resolveAll&&!a.includes(Y)&&a.push(Y),Y.resolve&&Lr(h.events,K,h.events.length-K,Y.resolve(h.events.slice(K),h)),Y.resolveTo&&(h.events=Y.resolveTo(h.events,h))}function B(){const Y=_(),K=h.previous,H=h.currentConstruct,J=h.events.length,Q=Array.from(o);return{from:J,restore:Z};function Z(){i=Y,h.previous=K,h.currentConstruct=H,h.events.length=J,o=Q,U()}}function U(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function fF(n,e){const t=e.start._index,i=e.start._bufferIndex,r=e.end._index,a=e.end._bufferIndex;let l;if(t===r)l=[n[t].slice(i,a)];else{if(l=n.slice(t,r),i>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(i):l.shift()}a>0&&l.push(n[r].slice(0,a))}return l}function pF(n,e){let t=-1;const i=[];let r;for(;++t<n.length;){const a=n[t];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
58
+ `;break}case-3:{l=`\r
59
+ `;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&r)continue;l=" ";break}default:l=String.fromCharCode(a)}r=a===-2,i.push(l)}return i.join("")}function mF(n){const i={constructs:K2([hF,...(n||{}).extensions||[]]),content:r(RP),defined:[],document:r(NP),flow:r(X8),lazy:{},string:r(Q8),text:r(eF)};return i;function r(a){return l;function l(o){return dF(i,a,o)}}}function gF(n){for(;!Q2(n););return n}const xC=/[\0\t\n\r]/g;function yF(){let n=1,e="",t=!0,i;return r;function r(a,l,o){const u=[];let h,p,f,m,g;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),f=0,e="",t&&(a.charCodeAt(0)===65279&&f++,t=void 0);f<a.length;){if(xC.lastIndex=f,h=xC.exec(a),m=h&&h.index!==void 0?h.index:a.length,g=a.charCodeAt(m),!h){e=a.slice(f);break}if(g===10&&f===m&&i)u.push(-3),i=void 0;else switch(i&&(u.push(-5),i=void 0),f<m&&(u.push(a.slice(f,m)),n+=m-f),g){case 0:{u.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,u.push(-2);n++<p;)u.push(-1);break}case 10:{u.push(-4),n=1;break}default:i=!0,n=1}f=m+1}return o&&(i&&u.push(-5),e&&u.push(e),u.push(null)),u}}const _F=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bF(n){return n.replace(_F,vF)}function vF(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const r=t.charCodeAt(1),a=r===120||r===88;return Y2(t.slice(a?2:1),a?16:10)}return Lb(t)||n}const sk={}.hasOwnProperty;function xF(n,e,t){return e&&typeof e=="object"&&(t=e,e=void 0),SF(t)(gF(mF(t).document().write(yF()(n,e,!0))))}function SF(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Lt),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(qe),blockQuote:a(xe),characterEscape:B,characterReference:B,codeFenced:a(Ze),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ze,l),codeText:a(De,l),codeTextData:B,data:B,codeFlowValue:B,definition:a(wt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Fe),hardBreakEscape:a(ze),hardBreakTrailing:a(ze),htmlFlow:a(Ue,l),htmlFlowData:B,htmlText:a(Ue,l),htmlTextData:B,image:a(at),label:l,link:a(Lt),listItem:a(Tt),listItemValue:m,listOrdered:a(St,f),listUnordered:a(St),paragraph:a(Re),reference:W,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(qe),strong:a(He),thematicBreak:a(kt)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:Ce,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:Ne,characterReference:le,codeFenced:u(v),codeFencedFence:w,codeFencedFenceInfo:g,codeFencedFenceMeta:_,codeFlowValue:U,codeIndented:u(x),codeText:u(Q),codeTextData:U,data:U,definition:u(),definitionDestinationString:C,definitionLabelString:S,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(K),hardBreakTrailing:u(K),htmlFlow:u(H),htmlFlowData:U,htmlText:u(J),htmlTextData:U,image:u(ie),label:P,labelText:ne,lineEnding:Y,link:u(Z),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ye,resourceDestinationString:L,resourceTitleString:F,resource:$,setextHeading:u(N),setextHeadingLineSequence:D,setextHeadingText:M,strong:u(),thematicBreak:u()}};ak(e,(n||{}).mdastExtensions||[]);const t={};return i;function i(_e){let Ve={type:"root",children:[]};const ft={stack:[Ve],tokenStack:[],config:e,enter:o,exit:h,buffer:l,resume:p,data:t},Et=[];let Pt=-1;for(;++Pt<_e.length;)if(_e[Pt][1].type==="listOrdered"||_e[Pt][1].type==="listUnordered")if(_e[Pt][0]==="enter")Et.push(Pt);else{const Tn=Et.pop();Pt=r(_e,Tn,Pt)}for(Pt=-1;++Pt<_e.length;){const Tn=e[_e[Pt][0]];sk.call(Tn,_e[Pt][1].type)&&Tn[_e[Pt][1].type].call(Object.assign({sliceSerialize:_e[Pt][2].sliceSerialize},ft),_e[Pt][1])}if(ft.tokenStack.length>0){const Tn=ft.tokenStack[ft.tokenStack.length-1];(Tn[1]||SC).call(ft,void 0,Tn[0])}for(Ve.position={start:No(_e.length>0?_e[0][1].start:{line:1,column:1,offset:0}),end:No(_e.length>0?_e[_e.length-2][1].end:{line:1,column:1,offset:0})},Pt=-1;++Pt<e.transforms.length;)Ve=e.transforms[Pt](Ve)||Ve;return Ve}function r(_e,Ve,ft){let Et=Ve-1,Pt=-1,Tn=!1,Ht,Pn,Un,Vn;for(;++Et<=ft;){const et=_e[Et];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Pt++:Pt--,Vn=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Ht&&!Vn&&!Pt&&!Un&&(Un=Et),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Pt&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Pt===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Ht){let Fi=Et;for(Pn=void 0;Fi--;){const Jn=_e[Fi];if(Jn[1].type==="lineEnding"||Jn[1].type==="lineEndingBlank"){if(Jn[0]==="exit")continue;Pn&&(_e[Pn][1].type="lineEndingBlank",Tn=!0),Jn[1].type="lineEnding",Pn=Fi}else if(!(Jn[1].type==="linePrefix"||Jn[1].type==="blockQuotePrefix"||Jn[1].type==="blockQuotePrefixWhitespace"||Jn[1].type==="blockQuoteMarker"||Jn[1].type==="listItemIndent"))break}Un&&(!Pn||Un<Pn)&&(Ht._spread=!0),Ht.end=Object.assign({},Pn?_e[Pn][1].start:et[1].end),_e.splice(Pn||Et,0,["exit",Ht,et[2]]),Et++,ft++}if(et[1].type==="listItemPrefix"){const Fi={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Ht=Fi,_e.splice(Et,0,["enter",Fi,et[2]]),Et++,ft++,Un=void 0,Vn=!0}}}return _e[Ve][1]._spread=Tn,ft}function a(_e,Ve){return ft;function ft(Et){o.call(this,_e(Et),Et),Ve&&Ve.call(this,Et)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(_e,Ve,ft){this.stack[this.stack.length-1].children.push(_e),this.stack.push(_e),this.tokenStack.push([Ve,ft||void 0]),_e.position={start:No(Ve.start),end:void 0}}function u(_e){return Ve;function Ve(ft){_e&&_e.call(this,ft),h.call(this,ft)}}function h(_e,Ve){const ft=this.stack.pop(),Et=this.tokenStack.pop();if(Et)Et[0].type!==_e.type&&(Ve?Ve.call(this,_e,Et[0]):(Et[1]||SC).call(this,_e,Et[0]));else throw new Error("Cannot close `"+_e.type+"` ("+jh({start:_e.start,end:_e.end})+"): it’s not open");ft.position.end=No(_e.end)}function p(){return Ib(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(_e){if(this.data.expectingFirstListItemValue){const Ve=this.stack[this.stack.length-2];Ve.start=Number.parseInt(this.sliceSerialize(_e),10),this.data.expectingFirstListItemValue=void 0}}function g(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.lang=_e}function _(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.meta=_e}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.value=_e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.value=_e.replace(/(\r?\n|\r)$/g,"")}function S(_e){const Ve=this.resume(),ft=this.stack[this.stack.length-1];ft.label=Ve,ft.identifier=Ss(this.sliceSerialize(_e)).toLowerCase()}function b(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.title=_e}function C(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.url=_e}function O(_e){const Ve=this.stack[this.stack.length-1];if(!Ve.depth){const ft=this.sliceSerialize(_e).length;Ve.depth=ft}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(_e){const Ve=this.stack[this.stack.length-1];Ve.depth=this.sliceSerialize(_e).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function B(_e){const ft=this.stack[this.stack.length-1].children;let Et=ft[ft.length-1];(!Et||Et.type!=="text")&&(Et=st(),Et.position={start:No(_e.start),end:void 0},ft.push(Et)),this.stack.push(Et)}function U(_e){const Ve=this.stack.pop();Ve.value+=this.sliceSerialize(_e),Ve.position.end=No(_e.end)}function Y(_e){const Ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ft=Ve.children[Ve.children.length-1];ft.position.end=No(_e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Ve.type)&&(B.call(this,_e),U.call(this,_e))}function K(){this.data.atHardBreak=!0}function H(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.value=_e}function J(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.value=_e}function Q(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.value=_e}function Z(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const Ve=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=Ve,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function ie(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const Ve=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=Ve,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function ne(_e){const Ve=this.sliceSerialize(_e),ft=this.stack[this.stack.length-2];ft.label=bF(Ve),ft.identifier=Ss(Ve).toLowerCase()}function P(){const _e=this.stack[this.stack.length-1],Ve=this.resume(),ft=this.stack[this.stack.length-1];if(this.data.inReference=!0,ft.type==="link"){const Et=_e.children;ft.children=Et}else ft.alt=Ve}function L(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.url=_e}function F(){const _e=this.resume(),Ve=this.stack[this.stack.length-1];Ve.title=_e}function $(){this.data.inReference=void 0}function W(){this.data.referenceType="collapsed"}function ye(_e){const Ve=this.resume(),ft=this.stack[this.stack.length-1];ft.label=Ve,ft.identifier=Ss(this.sliceSerialize(_e)).toLowerCase(),this.data.referenceType="full"}function be(_e){this.data.characterReferenceType=_e.type}function Ne(_e){const Ve=this.sliceSerialize(_e),ft=this.data.characterReferenceType;let Et;ft?(Et=Y2(Ve,ft==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Et=Lb(Ve);const Pt=this.stack[this.stack.length-1];Pt.value+=Et}function le(_e){const Ve=this.stack.pop();Ve.position.end=No(_e.end)}function ee(_e){U.call(this,_e);const Ve=this.stack[this.stack.length-1];Ve.url=this.sliceSerialize(_e)}function Ce(_e){U.call(this,_e);const Ve=this.stack[this.stack.length-1];Ve.url="mailto:"+this.sliceSerialize(_e)}function xe(){return{type:"blockquote",children:[]}}function Ze(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function Ue(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function St(_e){return{type:"list",ordered:_e.type==="listOrdered",start:null,spread:_e._spread,children:[]}}function Tt(_e){return{type:"listItem",spread:_e._spread,checked:null,children:[]}}function Re(){return{type:"paragraph",children:[]}}function He(){return{type:"strong",children:[]}}function st(){return{type:"text",value:""}}function kt(){return{type:"thematicBreak"}}}function No(n){return{line:n.line,column:n.column,offset:n.offset}}function ak(n,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?ak(n,i):wF(n,i)}}function wF(n,e){let t;for(t in e)if(sk.call(e,t))switch(t){case"canContainEols":{const i=e[t];i&&n[t].push(...i);break}case"transforms":{const i=e[t];i&&n[t].push(...i);break}case"enter":case"exit":{const i=e[t];i&&Object.assign(n[t],i);break}}}function SC(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+jh({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+jh({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+jh({start:e.start,end:e.end})+") is still open")}function CF(n){const e=this;e.parser=t;function t(i){return xF(i,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function EF(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function kF(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
60
+ `}]}function AF(n,e){const t=e.value?e.value+`
61
+ `:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return e.meta&&(a.data={meta:e.meta}),n.patch(e,a),a=n.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},n.patch(e,a),a}function TF(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function MF(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function RF(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=gu(i.toLowerCase()),a=n.footnoteOrder.indexOf(i);let l,o=n.footnoteCounts.get(i);o===void 0?(o=0,n.footnoteOrder.push(i),l=n.footnoteOrder.length):l=a+1,o+=1,n.footnoteCounts.set(i,o);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};n.patch(e,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return n.patch(e,h),n.applyData(e,h)}function OF(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function NF(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function ok(n,e){const t=e.referenceType;let i="]";if(t==="collapsed"?i+="[]":t==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=n.all(e),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function DF(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return ok(n,e);const r={src:gu(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return n.patch(e,a),n.applyData(e,a)}function IF(n,e){const t={src:gu(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,i),n.applyData(e,i)}function LF(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const i={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,i),n.applyData(e,i)}function BF(n,e){const t=String(e.identifier).toUpperCase(),i=n.definitionById.get(t);if(!i)return ok(n,e);const r={href:gu(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:n.all(e)};return n.patch(e,a),n.applyData(e,a)}function zF(n,e){const t={href:gu(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const i={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function PF(n,e,t){const i=n.all(e),r=t?FF(t):lk(e),a={},l=[];if(typeof e.checked=="boolean"){const p=i[0];let f;p&&p.type==="element"&&p.tagName==="p"?f=p:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<i.length;){const p=i[o];(r||o!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
62
+ `}),p.type==="element"&&p.tagName==="p"&&!r?l.push(...p.children):l.push(p)}const u=i[i.length-1];u&&(r||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
63
+ `});const h={type:"element",tagName:"li",properties:a,children:l};return n.patch(e,h),n.applyData(e,h)}function FF(n){let e=!1;if(n.type==="list"){e=n.spread||!1;const t=n.children;let i=-1;for(;!e&&++i<t.length;)e=lk(t[i])}return e}function lk(n){const e=n.spread;return e??n.children.length>1}function jF(n,e){const t={},i=n.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(i,!0)};return n.patch(e,a),n.applyData(e,a)}function UF(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function HF(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function qF(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function VF(n,e){const t=n.all(e),i=t.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:n.wrap([i],!0)};n.patch(e.children[0],l),r.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},o=Rb(e.children[1]),u=U2(e.children[e.children.length-1]);o&&u&&(l.position={start:o,end:u}),r.push(l)}const a={type:"element",tagName:"table",properties:{},children:n.wrap(r,!0)};return n.patch(e,a),n.applyData(e,a)}function WF(n,e,t){const i=t?t.children:void 0,a=(i?i.indexOf(e):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:e.children.length;let u=-1;const h=[];for(;++u<o;){const f=e.children[u],m={},g=l?l[u]:void 0;g&&(m.align=g);let _={type:"element",tagName:a,properties:m,children:[]};f&&(_.children=n.all(f),n.patch(f,_),_=n.applyData(f,_)),h.push(_)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(e,p),n.applyData(e,p)}function $F(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const wC=9,CC=32;function GF(n){const e=String(n),t=/\r?\n|\r/g;let i=t.exec(e),r=0;const a=[];for(;i;)a.push(EC(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return a.push(EC(e.slice(r),r>0,!1)),a.join("")}function EC(n,e,t){let i=0,r=n.length;if(e){let a=n.codePointAt(i);for(;a===wC||a===CC;)i++,a=n.codePointAt(i)}if(t){let a=n.codePointAt(r-1);for(;a===wC||a===CC;)r--,a=n.codePointAt(r-1)}return r>i?n.slice(i,r):""}function KF(n,e){const t={type:"text",value:GF(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function YF(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const XF={blockquote:EF,break:kF,code:AF,delete:TF,emphasis:MF,footnoteReference:RF,heading:OF,html:NF,imageReference:DF,image:IF,inlineCode:LF,linkReference:BF,link:zF,listItem:PF,list:jF,paragraph:UF,root:HF,strong:qF,table:VF,tableCell:$F,tableRow:WF,text:KF,thematicBreak:YF,toml:gp,yaml:gp,definition:gp,footnoteDefinition:gp};function gp(){}const ck=-1,wm=0,Hh=1,Qp=2,zb=3,Pb=4,Fb=5,jb=6,uk=7,hk=8,kC=typeof self=="object"?self:globalThis,ZF=(n,e)=>{const t=(r,a)=>(n.set(a,r),r),i=r=>{if(n.has(r))return n.get(r);const[a,l]=e[r];switch(a){case wm:case ck:return t(l,r);case Hh:{const o=t([],r);for(const u of l)o.push(i(u));return o}case Qp:{const o=t({},r);for(const[u,h]of l)o[i(u)]=i(h);return o}case zb:return t(new Date(l),r);case Pb:{const{source:o,flags:u}=l;return t(new RegExp(o,u),r)}case Fb:{const o=t(new Map,r);for(const[u,h]of l)o.set(i(u),i(h));return o}case jb:{const o=t(new Set,r);for(const u of l)o.add(i(u));return o}case uk:{const{name:o,message:u}=l;return t(new kC[o](u),r)}case hk:return t(BigInt(l),r);case"BigInt":return t(Object(BigInt(l)),r);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return t(new DataView(o),l)}}return t(new kC[a](l),r)};return i},AC=n=>ZF(new Map,n)(0),$c="",{toString:JF}={},{keys:QF}=Object,Th=n=>{const e=typeof n;if(e!=="object"||!n)return[wm,e];const t=JF.call(n).slice(8,-1);switch(t){case"Array":return[Hh,$c];case"Object":return[Qp,$c];case"Date":return[zb,$c];case"RegExp":return[Pb,$c];case"Map":return[Fb,$c];case"Set":return[jb,$c];case"DataView":return[Hh,t]}return t.includes("Array")?[Hh,t]:t.includes("Error")?[uk,t]:[Qp,t]},yp=([n,e])=>n===wm&&(e==="function"||e==="symbol"),e9=(n,e,t,i)=>{const r=(l,o)=>{const u=i.push(l)-1;return t.set(o,u),u},a=l=>{if(t.has(l))return t.get(l);let[o,u]=Th(l);switch(o){case wm:{let p=l;switch(u){case"bigint":o=hk,p=l.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return r([ck],l)}return r([o,p],l)}case Hh:{if(u){let m=l;return u==="DataView"?m=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(l)),r([u,[...m]],l)}const p=[],f=r([o,p],l);for(const m of l)p.push(a(m));return f}case Qp:{if(u)switch(u){case"BigInt":return r([u,l.toString()],l);case"Boolean":case"Number":case"String":return r([u,l.valueOf()],l)}if(e&&"toJSON"in l)return a(l.toJSON());const p=[],f=r([o,p],l);for(const m of QF(l))(n||!yp(Th(l[m])))&&p.push([a(m),a(l[m])]);return f}case zb:return r([o,l.toISOString()],l);case Pb:{const{source:p,flags:f}=l;return r([o,{source:p,flags:f}],l)}case Fb:{const p=[],f=r([o,p],l);for(const[m,g]of l)(n||!(yp(Th(m))||yp(Th(g))))&&p.push([a(m),a(g)]);return f}case jb:{const p=[],f=r([o,p],l);for(const m of l)(n||!yp(Th(m)))&&p.push(a(m));return f}}const{message:h}=l;return r([o,{name:u,message:h}],l)};return a},TC=(n,{json:e,lossy:t}={})=>{const i=[];return e9(!(e||t),!!e,new Map,i)(n),i},em=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?AC(TC(n,e)):structuredClone(n):(n,e)=>AC(TC(n,e));function t9(n,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function n9(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function i9(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||t9,i=n.options.footnoteBackLabel||n9,r=n.options.footnoteLabel||"Footnotes",a=n.options.footnoteLabelTagName||"h2",l=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[u]);if(!h)continue;const p=n.all(h),f=String(h.identifier).toUpperCase(),m=gu(f.toLowerCase());let g=0;const _=[],w=n.footnoteCounts.get(f);for(;w!==void 0&&++g<=w;){_.length>0&&_.push({type:"text",value:" "});let S=typeof t=="string"?t:t(u,g);typeof S=="string"&&(S={type:"text",value:S}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(u,g),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const v=p[p.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const S=v.children[v.children.length-1];S&&S.type==="text"?S.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(..._)}else p.push(..._);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+m},children:n.wrap(p,!0)};n.patch(h,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...em(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
64
+ `},{type:"element",tagName:"ol",properties:{},children:n.wrap(o,!0)},{type:"text",value:`
65
+ `}]}}const hd=(function(n){if(n==null)return o9;if(typeof n=="function")return Cm(n);if(typeof n=="object")return Array.isArray(n)?r9(n):s9(n);if(typeof n=="string")return a9(n);throw new Error("Expected function, string, or object as test")});function r9(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=hd(n[t]);return Cm(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function s9(n){const e=n;return Cm(t);function t(i){const r=i;let a;for(a in n)if(r[a]!==e[a])return!1;return!0}}function a9(n){return Cm(e);function e(t){return t&&t.type===n}}function Cm(n){return e;function e(t,i,r){return!!(l9(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function o9(){return!0}function l9(n){return n!==null&&typeof n=="object"&&"type"in n}const dk=[],c9=!0,S0=!1,u9="skip";function fk(n,e,t,i){let r;typeof e=="function"&&typeof t!="function"?(i=t,t=e):r=e;const a=hd(r),l=i?-1:1;o(n,void 0,[])();function o(u,h,p){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=dk,_,w,v;if((!e||a(u,h,p[p.length-1]||void 0))&&(g=h9(t(u,p)),g[0]===S0))return g;if("children"in u&&u.children){const x=u;if(x.children&&g[0]!==u9)for(w=(i?x.children.length:-1)+l,v=p.concat(x);w>-1&&w<x.children.length;){const S=x.children[w];if(_=o(S,w,v)(),_[0]===S0)return _;w=typeof _[1]=="number"?_[1]:w+l}}return g}}}function h9(n){return Array.isArray(n)?n:typeof n=="number"?[c9,n]:n==null?dk:[n]}function Em(n,e,t,i){let r,a,l;typeof e=="function"&&typeof t!="function"?(a=void 0,l=e,r=t):(a=e,l=t,r=i),fk(n,a,o,r);function o(u,h){const p=h[h.length-1],f=p?p.children.indexOf(u):void 0;return l(u,f,p)}}const w0={}.hasOwnProperty,d9={};function f9(n,e){const t=e||d9,i=new Map,r=new Map,a=new Map,l={...XF,...t.handlers},o={all:h,applyData:m9,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:l,one:u,options:t,patch:p9,wrap:y9};return Em(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const f=p.type==="definition"?i:r,m=String(p.identifier).toUpperCase();f.has(m)||f.set(m,p)}}),o;function u(p,f){const m=p.type,g=o.handlers[m];if(w0.call(o.handlers,m)&&g)return g(o,p,f);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in p){const{children:w,...v}=p,x=em(v);return x.children=o.all(p),x}return em(p)}return(o.options.unknownHandler||g9)(o,p,f)}function h(p){const f=[];if("children"in p){const m=p.children;let g=-1;for(;++g<m.length;){const _=o.one(m[g],p);if(_){if(g&&m[g-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=MC(_.value)),!Array.isArray(_)&&_.type==="element")){const w=_.children[0];w&&w.type==="text"&&(w.value=MC(w.value))}Array.isArray(_)?f.push(..._):f.push(_)}}}return f}}function p9(n,e){n.position&&(e.position=nP(n))}function m9(n,e){let t=e;if(n&&n.data){const i=n.data.hName,r=n.data.hChildren,a=n.data.hProperties;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const l="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:l}}t.type==="element"&&a&&Object.assign(t.properties,em(a)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function g9(n,e){const t=e.data||{},i="value"in e&&!(w0.call(t,"hProperties")||w0.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function y9(n,e){const t=[];let i=-1;for(e&&t.push({type:"text",value:`
66
+ `});++i<n.length;)i&&t.push({type:"text",value:`
67
+ `}),t.push(n[i]);return e&&n.length>0&&t.push({type:"text",value:`
68
+ `}),t}function MC(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function RC(n,e){const t=f9(n,e),i=t.one(n,void 0),r=i9(t),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
69
+ `},r),a}function _9(n,e){return n&&"run"in n?async function(t,i){const r=RC(t,{file:i,...e});await n.run(r,i)}:function(t,i){return RC(t,{file:i,...n||e})}}function OC(n){if(n)throw n}var E_,NC;function b9(){if(NC)return E_;NC=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},a=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),f=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!f)return!1;var m;for(m in h);return typeof m>"u"||n.call(h,m)},l=function(h,p){t&&p.name==="__proto__"?t(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},o=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(i)return i(h,p).value}else return;return h[p]};return E_=function u(){var h,p,f,m,g,_,w=arguments[0],v=1,x=arguments.length,S=!1;for(typeof w=="boolean"&&(S=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<x;++v)if(h=arguments[v],h!=null)for(p in h)f=o(w,p),m=o(h,p),w!==m&&(S&&m&&(a(m)||(g=r(m)))?(g?(g=!1,_=f&&r(f)?f:[]):_=f&&a(f)?f:{},l(w,{name:p,newValue:u(S,_,m)})):typeof m<"u"&&l(w,{name:p,newValue:m}));return w},E_}var v9=b9();const k_=id(v9);function C0(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function x9(){const n=[],e={run:t,use:i};return e;function t(...r){let a=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...r);function o(u,...h){const p=n[++a];let f=-1;if(u){l(u);return}for(;++f<r.length;)(h[f]===null||h[f]===void 0)&&(h[f]=r[f]);r=h,p?S9(p,o)(...h):l(null,...h)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return n.push(r),e}}function S9(n,e){let t;return i;function i(...l){const o=n.length>l.length;let u;o&&l.push(r);try{u=n.apply(this,l)}catch(h){const p=h;if(o&&t)throw p;return r(p)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,r):u instanceof Error?r(u):a(u))}function r(l,...o){t||(t=!0,e(l,...o))}function a(l){r(null,l)}}const Ws={basename:w9,dirname:C9,extname:E9,join:k9,sep:"/"};function w9(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');dd(n);let t=0,i=-1,r=n.length,a;if(e===void 0||e.length===0||e.length>n.length){for(;r--;)if(n.codePointAt(r)===47){if(a){t=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":n.slice(t,i)}if(e===n)return"";let l=-1,o=e.length-1;for(;r--;)if(n.codePointAt(r)===47){if(a){t=r+1;break}}else l<0&&(a=!0,l=r+1),o>-1&&(n.codePointAt(r)===e.codePointAt(o--)?o<0&&(i=r):(o=-1,i=l));return t===i?i=l:i<0&&(i=n.length),n.slice(t,i)}function C9(n){if(dd(n),n.length===0)return".";let e=-1,t=n.length,i;for(;--t;)if(n.codePointAt(t)===47){if(i){e=t;break}}else i||(i=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function E9(n){dd(n);let e=n.length,t=-1,i=0,r=-1,a=0,l;for(;e--;){const o=n.codePointAt(e);if(o===47){if(l){i=e+1;break}continue}t<0&&(l=!0,t=e+1),o===46?r<0?r=e:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||t<0||a===0||a===1&&r===t-1&&r===i+1?"":n.slice(r,t)}function k9(...n){let e=-1,t;for(;++e<n.length;)dd(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":A9(t)}function A9(n){dd(n);const e=n.codePointAt(0)===47;let t=T9(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function T9(n,e){let t="",i=0,r=-1,a=0,l=-1,o,u;for(;++l<=n.length;){if(l<n.length)o=n.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(r===l-1||a===1))if(r!==l-1&&a===2){if(t.length<2||i!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),r=l,a=0;continue}}else if(t.length>0){t="",i=0,r=l,a=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+n.slice(r+1,l):t=n.slice(r+1,l),i=l-r-1;r=l,a=0}else o===46&&a>-1?a++:a=-1}return t}function dd(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const M9={cwd:R9};function R9(){return"/"}function E0(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function O9(n){if(typeof n=="string")n=new URL(n);else if(!E0(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return N9(n)}function N9(n){if(n.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const i=e.codePointAt(t+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const A_=["history","path","basename","stem","extname","dirname"];class pk{constructor(e){let t;e?E0(e)?t={path:e}:typeof e=="string"||D9(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":M9.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<A_.length;){const a=A_[i];a in t&&t[a]!==void 0&&t[a]!==null&&(this[a]=a==="history"?[...t[a]]:t[a])}let r;for(r in t)A_.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path=="string"?Ws.basename(this.path):void 0}set basename(e){M_(e,"basename"),T_(e,"basename"),this.path=Ws.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ws.dirname(this.path):void 0}set dirname(e){DC(this.basename,"dirname"),this.path=Ws.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ws.extname(this.path):void 0}set extname(e){if(T_(e,"extname"),DC(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ws.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){E0(e)&&(e=O9(e)),M_(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ws.basename(this.path,this.extname):void 0}set stem(e){M_(e,"stem"),T_(e,"stem"),this.path=Ws.join(this.dirname||"",e+(this.extname||""))}fail(e,t,i){const r=this.message(e,t,i);throw r.fatal=!0,r}info(e,t,i){const r=this.message(e,t,i);return r.fatal=void 0,r}message(e,t,i){const r=new Zi(e,t,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function T_(n,e){if(n&&n.includes(Ws.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ws.sep+"`")}function M_(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function DC(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function D9(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const I9=(function(n){const i=this.constructor.prototype,r=i[n],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),L9={}.hasOwnProperty;class Ub extends I9{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=x9()}copy(){const e=new Ub;let t=-1;for(;++t<this.attachers.length;){const i=this.attachers[t];e.use(...i)}return e.data(k_(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(N_("data",this.frozen),this.namespace[e]=t,this):L9.call(this.namespace,e)&&this.namespace[e]||void 0:e?(N_("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=t.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=_p(e),i=this.parser||this.Parser;return R_("parse",i),i(String(t),t)}process(e,t){const i=this;return this.freeze(),R_("process",this.parser||this.Parser),O_("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(a,l){const o=_p(e),u=i.parse(o);i.run(u,o,function(p,f,m){if(p||!f||!m)return h(p);const g=f,_=i.stringify(g,m);P9(_)?m.value=_:m.result=_,h(p,m)});function h(p,f){p||!f?l(p):a?a(f):t(void 0,f)}}}processSync(e){let t=!1,i;return this.freeze(),R_("processSync",this.parser||this.Parser),O_("processSync",this.compiler||this.Compiler),this.process(e,r),LC("processSync","process",t),i;function r(a,l){t=!0,OC(a),i=l}}run(e,t,i){IC(e),this.freeze();const r=this.transformers;return!i&&typeof t=="function"&&(i=t,t=void 0),i?a(void 0,i):new Promise(a);function a(l,o){const u=_p(t);r.run(e,u,h);function h(p,f,m){const g=f||e;p?o(p):l?l(g):i(void 0,g,m)}}}runSync(e,t){let i=!1,r;return this.run(e,t,a),LC("runSync","run",i),r;function a(l,o){OC(l),r=o,i=!0}}stringify(e,t){this.freeze();const i=_p(t),r=this.compiler||this.Compiler;return O_("stringify",r),IC(e),r(e,i)}use(e,...t){const i=this.attachers,r=this.namespace;if(N_("use",this.frozen),e!=null)if(typeof e=="function")u(e,t);else if(typeof e=="object")Array.isArray(e)?o(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...f]=h;u(p,f)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");o(h.plugins),h.settings&&(r.settings=k_(!0,r.settings,h.settings))}function o(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const f=h[p];a(f)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,p){let f=-1,m=-1;for(;++f<i.length;)if(i[f][0]===h){m=f;break}if(m===-1)i.push([h,...p]);else if(p.length>0){let[g,..._]=p;const w=i[m][1];C0(w)&&C0(g)&&(g=k_(!0,w,g)),i[m]=[h,g,..._]}}}}const B9=new Ub().freeze();function R_(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function O_(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function N_(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function IC(n){if(!C0(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function LC(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function _p(n){return z9(n)?n:new pk(n)}function z9(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function P9(n){return typeof n=="string"||F9(n)}function F9(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const j9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",BC=[],zC={allowDangerousHtml:!0},U9=/^(https?|ircs?|mailto|xmpp)$/i,H9=[{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 q9(n){const e=V9(n),t=W9(n);return $9(e.runSync(e.parse(t),t),n)}function V9(n){const e=n.rehypePlugins||BC,t=n.remarkPlugins||BC,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...zC}:zC;return B9().use(CF).use(t).use(_9,i).use(e)}function W9(n){const e=n.children||"",t=new pk;return typeof e=="string"&&(t.value=e),t}function $9(n,e){const t=e.allowedElements,i=e.allowElement,r=e.components,a=e.disallowedElements,l=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||G9;for(const p of H9)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+j9+p.id,void 0);return Em(n,h),oP(n,{Fragment:A.Fragment,components:r,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function h(p,f,m){if(p.type==="raw"&&m&&typeof f=="number")return l?m.children.splice(f,1):m.children[f]={type:"text",value:p.value},f;if(p.type==="element"){let g;for(g in S_)if(Object.hasOwn(S_,g)&&Object.hasOwn(p.properties,g)){const _=p.properties[g],w=S_[g];(w===null||w.includes(p.tagName))&&(p.properties[g]=u(String(_||""),g,p))}}if(p.type==="element"){let g=t?!t.includes(p.tagName):a?a.includes(p.tagName):!1;if(!g&&i&&typeof f=="number"&&(g=!i(p,f,m)),g&&m&&typeof f=="number")return o&&p.children?m.children.splice(f,1,...p.children):m.children.splice(f,1),f}}}function G9(n){const e=n.indexOf(":"),t=n.indexOf("?"),i=n.indexOf("#"),r=n.indexOf("/");return e===-1||r!==-1&&e>r||t!==-1&&e>t||i!==-1&&e>i||U9.test(n.slice(0,e))?n:""}function PC(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=t.indexOf(e);for(;r!==-1;)i++,r=t.indexOf(e,r+e.length);return i}function K9(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Y9(n,e,t){const r=hd((t||{}).ignore||[]),a=X9(e);let l=-1;for(;++l<a.length;)fk(n,"text",o);function o(h,p){let f=-1,m;for(;++f<p.length;){const g=p[f],_=m?m.children:void 0;if(r(g,_?_.indexOf(g):void 0,m))return;m=g}if(m)return u(h,p)}function u(h,p){const f=p[p.length-1],m=a[l][0],g=a[l][1];let _=0;const v=f.children.indexOf(h);let x=!1,S=[];m.lastIndex=0;let b=m.exec(h.value);for(;b;){const C=b.index,O={index:b.index,input:b.input,stack:[...p,h]};let M=g(...b,O);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=C+1:(_!==C&&S.push({type:"text",value:h.value.slice(_,C)}),Array.isArray(M)?S.push(...M):M&&S.push(M),_=C+b[0].length,x=!0),!m.global)break;b=m.exec(h.value)}return x?(_<h.value.length&&S.push({type:"text",value:h.value.slice(_)}),f.children.splice(v,1,...S)):S=[h],v+S.length}}function X9(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let i=-1;for(;++i<t.length;){const r=t[i];e.push([Z9(r[0]),J9(r[1])])}return e}function Z9(n){return typeof n=="string"?new RegExp(K9(n),"g"):n}function J9(n){return typeof n=="function"?n:function(){return n}}const D_="phrasing",I_=["autolink","link","image","label"];function Q9(){return{transforms:[a7],enter:{literalAutolink:t7,literalAutolinkEmail:L_,literalAutolinkHttp:L_,literalAutolinkWww:L_},exit:{literalAutolink:s7,literalAutolinkEmail:r7,literalAutolinkHttp:n7,literalAutolinkWww:i7}}}function e7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:D_,notInConstruct:I_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:D_,notInConstruct:I_},{character:":",before:"[ps]",after:"\\/",inConstruct:D_,notInConstruct:I_}]}}function t7(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function L_(n){this.config.enter.autolinkProtocol.call(this,n)}function n7(n){this.config.exit.autolinkProtocol.call(this,n)}function i7(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function r7(n){this.config.exit.autolinkEmail.call(this,n)}function s7(n){this.exit(n)}function a7(n){Y9(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,o7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),l7]],{ignore:["link","linkReference"]})}function o7(n,e,t,i,r){let a="";if(!mk(r)||(/^w/i.test(e)&&(t=e+t,e="",a="http://"),!c7(t)))return!1;const l=u7(t+i);if(!l[0])return!1;const o={type:"link",title:null,url:a+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function l7(n,e,t,i){return!mk(i,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function c7(n){const e=n.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function u7(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],i=t.indexOf(")");const r=PC(n,"(");let a=PC(n,")");for(;i!==-1&&r>a;)n+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[n,t]}function mk(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||Al(t)||xm(t))&&(!e||t!==47)}gk.peek=b7;function h7(){this.buffer()}function d7(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function f7(){this.buffer()}function p7(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function m7(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ss(this.sliceSerialize(n)).toLowerCase(),t.label=e}function g7(n){this.exit(n)}function y7(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ss(this.sliceSerialize(n)).toLowerCase(),t.label=e}function _7(n){this.exit(n)}function b7(){return"["}function gk(n,e,t,i){const r=t.createTracker(i);let a=r.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return a+=r.move(t.safe(t.associationId(n),{after:"]",before:a})),o(),l(),a+=r.move("]"),a}function v7(){return{enter:{gfmFootnoteCallString:h7,gfmFootnoteCall:d7,gfmFootnoteDefinitionLabelString:f7,gfmFootnoteDefinition:p7},exit:{gfmFootnoteCallString:m7,gfmFootnoteCall:g7,gfmFootnoteDefinitionLabelString:y7,gfmFootnoteDefinition:_7}}}function x7(n){let e=!1;return n&&n.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:gk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,r,a,l){const o=a.createTracker(l);let u=o.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return u+=o.move(a.safe(a.associationId(i),{before:u,after:"]"})),p(),u+=o.move("]:"),i.children&&i.children.length>0&&(o.shift(4),u+=o.move((e?`
70
+ `:" ")+a.indentLines(a.containerFlow(i,o.current()),e?yk:S7))),h(),u}}function S7(n,e,t){return e===0?n:yk(n,e,t)}function yk(n,e,t){return(t?"":" ")+n}const w7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_k.peek=T7;function C7(){return{canContainEols:["delete"],enter:{strikethrough:k7},exit:{strikethrough:A7}}}function E7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:w7}],handlers:{delete:_k}}}function k7(n){this.enter({type:"delete",children:[]},n)}function A7(n){this.exit(n)}function _k(n,e,t,i){const r=t.createTracker(i),a=t.enter("strikethrough");let l=r.move("~~");return l+=t.containerPhrasing(n,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),a(),l}function T7(){return"~"}function M7(n){return n.length}function R7(n,e){const t=e||{},i=(t.align||[]).concat(),r=t.stringLength||M7,a=[],l=[],o=[],u=[];let h=0,p=-1;for(;++p<n.length;){const w=[],v=[];let x=-1;for(n[p].length>h&&(h=n[p].length);++x<n[p].length;){const S=O7(n[p][x]);if(t.alignDelimiters!==!1){const b=r(S);v[x]=b,(u[x]===void 0||b>u[x])&&(u[x]=b)}w.push(S)}l[p]=w,o[p]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++f<h;)a[f]=FC(i[f]);else{const w=FC(i);for(;++f<h;)a[f]=w}f=-1;const m=[],g=[];for(;++f<h;){const w=a[f];let v="",x="";w===99?(v=":",x=":"):w===108?v=":":w===114&&(x=":");let S=t.alignDelimiters===!1?1:Math.max(1,u[f]-v.length-x.length);const b=v+"-".repeat(S)+x;t.alignDelimiters!==!1&&(S=v.length+S+x.length,S>u[f]&&(u[f]=S),g[f]=S),m[f]=b}l.splice(1,0,m),o.splice(1,0,g),p=-1;const _=[];for(;++p<l.length;){const w=l[p],v=o[p];f=-1;const x=[];for(;++f<h;){const S=w[f]||"";let b="",C="";if(t.alignDelimiters!==!1){const O=u[f]-(v[f]||0),M=a[f];M===114?b=" ".repeat(O):M===99?O%2?(b=" ".repeat(O/2+.5),C=" ".repeat(O/2-.5)):(b=" ".repeat(O/2),C=b):C=" ".repeat(O)}t.delimiterStart!==!1&&!f&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&S==="")&&(t.delimiterStart!==!1||f)&&x.push(" "),t.alignDelimiters!==!1&&x.push(b),x.push(S),t.alignDelimiters!==!1&&x.push(C),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||f!==h-1)&&x.push("|")}_.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return _.join(`
71
+ `)}function O7(n){return n==null?"":String(n)}function FC(n){const e=typeof n=="string"?n.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function N7(n,e,t,i){const r=t.enter("blockquote"),a=t.createTracker(i);a.move("> "),a.shift(2);const l=t.indentLines(t.containerFlow(n,a.current()),D7);return r(),l}function D7(n,e,t){return">"+(t?"":" ")+n}function I7(n,e){return jC(n,e.inConstruct,!0)&&!jC(n,e.notInConstruct,!1)}function jC(n,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let i=-1;for(;++i<e.length;)if(n.includes(e[i]))return!0;return!1}function UC(n,e,t,i){let r=-1;for(;++r<t.unsafe.length;)if(t.unsafe[r].character===`
72
+ `&&I7(t.stack,t.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
73
+ `}function L7(n,e){const t=String(n);let i=t.indexOf(e),r=i,a=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++a>l&&(l=a):a=1,r=i+e.length,i=t.indexOf(e,r);return l}function B7(n,e){return!!(e.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function z7(n){const e=n.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function P7(n,e,t,i){const r=z7(t),a=n.value||"",l=r==="`"?"GraveAccent":"Tilde";if(B7(n,t)){const f=t.enter("codeIndented"),m=t.indentLines(a,F7);return f(),m}const o=t.createTracker(i),u=r.repeat(Math.max(L7(a,r)+1,3)),h=t.enter("codeFenced");let p=o.move(u);if(n.lang){const f=t.enter(`codeFencedLang${l}`);p+=o.move(t.safe(n.lang,{before:p,after:" ",encode:["`"],...o.current()})),f()}if(n.lang&&n.meta){const f=t.enter(`codeFencedMeta${l}`);p+=o.move(" "),p+=o.move(t.safe(n.meta,{before:p,after:`
74
+ `,encode:["`"],...o.current()})),f()}return p+=o.move(`
75
+ `),a&&(p+=o.move(a+`
76
+ `)),p+=o.move(u),h(),p}function F7(n,e,t){return(t?"":" ")+n}function Hb(n){const e=n.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function j7(n,e,t,i){const r=Hb(t),a=r==='"'?"Quote":"Apostrophe",l=t.enter("definition");let o=t.enter("label");const u=t.createTracker(i);let h=u.move("[");return h+=u.move(t.safe(t.associationId(n),{before:h,after:"]",...u.current()})),h+=u.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(o=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":`
77
+ `,...u.current()}))),o(),n.title&&(o=t.enter(`title${a}`),h+=u.move(" "+r),h+=u.move(t.safe(n.title,{before:h,after:r,...u.current()})),h+=u.move(r),o()),l(),h}function U7(n){const e=n.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function td(n){return"&#x"+n.toString(16).toUpperCase()+";"}function tm(n,e,t){const i=au(n),r=au(e);return i===void 0?r===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}bk.peek=H7;function bk(n,e,t,i){const r=U7(t),a=t.enter("emphasis"),l=t.createTracker(i),o=l.move(r);let u=l.move(t.containerPhrasing(n,{after:r,before:o,...l.current()}));const h=u.charCodeAt(0),p=tm(i.before.charCodeAt(i.before.length-1),h,r);p.inside&&(u=td(h)+u.slice(1));const f=u.charCodeAt(u.length-1),m=tm(i.after.charCodeAt(0),f,r);m.inside&&(u=u.slice(0,-1)+td(f));const g=l.move(r);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},o+u+g}function H7(n,e,t){return t.options.emphasis||"*"}function q7(n,e){let t=!1;return Em(n,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return t=!0,S0}),!!((!n.depth||n.depth<3)&&Ib(n)&&(e.options.setext||t))}function V7(n,e,t,i){const r=Math.max(Math.min(6,n.depth||1),1),a=t.createTracker(i);if(q7(n,t)){const p=t.enter("headingSetext"),f=t.enter("phrasing"),m=t.containerPhrasing(n,{...a.current(),before:`
78
+ `,after:`
79
+ `});return f(),p(),m+`
80
+ `+(r===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
81
+ `))+1))}const l="#".repeat(r),o=t.enter("headingAtx"),u=t.enter("phrasing");a.move(l+" ");let h=t.containerPhrasing(n,{before:"# ",after:`
82
+ `,...a.current()});return/^[\t ]/.test(h)&&(h=td(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,t.options.closeAtx&&(h+=" "+l),u(),o(),h}vk.peek=W7;function vk(n){return n.value||""}function W7(){return"<"}xk.peek=$7;function xk(n,e,t,i){const r=Hb(t),a=r==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const u=t.createTracker(i);let h=u.move("![");return h+=u.move(t.safe(n.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(o=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":")",...u.current()}))),o(),n.title&&(o=t.enter(`title${a}`),h+=u.move(" "+r),h+=u.move(t.safe(n.title,{before:h,after:r,...u.current()})),h+=u.move(r),o()),h+=u.move(")"),l(),h}function $7(){return"!"}Sk.peek=G7;function Sk(n,e,t,i){const r=n.referenceType,a=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(i);let u=o.move("![");const h=t.safe(n.alt,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const p=t.stack;t.stack=[],l=t.enter("reference");const f=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=p,a(),r==="full"||!h||h!==f?u+=o.move(f+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function G7(){return"!"}wk.peek=K7;function wk(n,e,t){let i=n.value||"",r="`",a=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<t.unsafe.length;){const l=t.unsafe[a],o=t.compilePattern(l);let u;if(l.atBreak)for(;u=o.exec(i);){let h=u.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(u.index+1)}}return r+i+r}function K7(){return"`"}function Ck(n,e){const t=Ib(n);return!!(!e.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(t===n.url||"mailto:"+t===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}Ek.peek=Y7;function Ek(n,e,t,i){const r=Hb(t),a=r==='"'?"Quote":"Apostrophe",l=t.createTracker(i);let o,u;if(Ck(n,t)){const p=t.stack;t.stack=[],o=t.enter("autolink");let f=l.move("<");return f+=l.move(t.containerPhrasing(n,{before:f,after:">",...l.current()})),f+=l.move(">"),o(),t.stack=p,f}o=t.enter("link"),u=t.enter("label");let h=l.move("[");return h+=l.move(t.containerPhrasing(n,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(u=t.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(t.safe(n.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=t.enter("destinationRaw"),h+=l.move(t.safe(n.url,{before:h,after:n.title?" ":")",...l.current()}))),u(),n.title&&(u=t.enter(`title${a}`),h+=l.move(" "+r),h+=l.move(t.safe(n.title,{before:h,after:r,...l.current()})),h+=l.move(r),u()),h+=l.move(")"),o(),h}function Y7(n,e,t){return Ck(n,t)?"<":"["}kk.peek=X7;function kk(n,e,t,i){const r=n.referenceType,a=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(i);let u=o.move("[");const h=t.containerPhrasing(n,{before:u,after:"]",...o.current()});u+=o.move(h+"]["),l();const p=t.stack;t.stack=[],l=t.enter("reference");const f=t.safe(t.associationId(n),{before:u,after:"]",...o.current()});return l(),t.stack=p,a(),r==="full"||!h||h!==f?u+=o.move(f+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function X7(){return"["}function qb(n){const e=n.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Z7(n){const e=qb(n),t=n.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function J7(n){const e=n.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Ak(n){const e=n.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Q7(n,e,t,i){const r=t.enter("list"),a=t.bulletCurrent;let l=n.ordered?J7(t):qb(t);const o=n.ordered?l==="."?")":".":Z7(t);let u=e&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!n.ordered){const p=n.children?n.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),Ak(t)===l&&p){let f=-1;for(;++f<n.children.length;){const m=n.children[f];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=o),t.bulletCurrent=l;const h=t.containerFlow(n,i);return t.bulletLastUsed=l,t.bulletCurrent=a,r(),h}function ej(n){const e=n.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function tj(n,e,t,i){const r=ej(t);let a=t.bulletCurrent||qb(t);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(n))+a);let l=a.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||n.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(i);o.move(a+" ".repeat(l-a.length)),o.shift(l);const u=t.enter("listItem"),h=t.indentLines(t.containerFlow(n,o.current()),p);return u(),h;function p(f,m,g){return m?(g?"":" ".repeat(l))+f:(g?a:a+" ".repeat(l-a.length))+f}}function nj(n,e,t,i){const r=t.enter("paragraph"),a=t.enter("phrasing"),l=t.containerPhrasing(n,i);return a(),r(),l}const ij=hd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rj(n,e,t,i){return(n.children.some(function(l){return ij(l)})?t.containerPhrasing:t.containerFlow).call(t,n,i)}function sj(n){const e=n.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Tk.peek=aj;function Tk(n,e,t,i){const r=sj(t),a=t.enter("strong"),l=t.createTracker(i),o=l.move(r+r);let u=l.move(t.containerPhrasing(n,{after:r,before:o,...l.current()}));const h=u.charCodeAt(0),p=tm(i.before.charCodeAt(i.before.length-1),h,r);p.inside&&(u=td(h)+u.slice(1));const f=u.charCodeAt(u.length-1),m=tm(i.after.charCodeAt(0),f,r);m.inside&&(u=u.slice(0,-1)+td(f));const g=l.move(r+r);return a(),t.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},o+u+g}function aj(n,e,t){return t.options.strong||"*"}function oj(n,e,t,i){return t.safe(n.value,i)}function lj(n){const e=n.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function cj(n,e,t){const i=(Ak(t)+(t.options.ruleSpaces?" ":"")).repeat(lj(t));return t.options.ruleSpaces?i.slice(0,-1):i}const Mk={blockquote:N7,break:UC,code:P7,definition:j7,emphasis:bk,hardBreak:UC,heading:V7,html:vk,image:xk,imageReference:Sk,inlineCode:wk,link:Ek,linkReference:kk,list:Q7,listItem:tj,paragraph:nj,root:rj,strong:Tk,text:oj,thematicBreak:cj};function uj(){return{enter:{table:hj,tableData:HC,tableHeader:HC,tableRow:fj},exit:{codeText:pj,table:dj,tableData:B_,tableHeader:B_,tableRow:B_}}}function hj(n){const e=n._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},n),this.data.inTable=!0}function dj(n){this.exit(n),this.data.inTable=void 0}function fj(n){this.enter({type:"tableRow",children:[]},n)}function B_(n){this.exit(n)}function HC(n){this.enter({type:"tableCell",children:[]},n)}function pj(n){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,mj));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(n)}function mj(n,e){return e==="|"?e:n}function gj(n){const e=n||{},t=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,a=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
83
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:u,tableRow:o}};function l(g,_,w,v){return h(p(g,w,v),g.align)}function o(g,_,w,v){const x=f(g,w,v),S=h([x]);return S.slice(0,S.indexOf(`
84
+ `))}function u(g,_,w,v){const x=w.enter("tableCell"),S=w.enter("phrasing"),b=w.containerPhrasing(g,{...v,before:a,after:a});return S(),x(),b}function h(g,_){return R7(g,{align:_,alignDelimiters:i,padding:t,stringLength:r})}function p(g,_,w){const v=g.children;let x=-1;const S=[],b=_.enter("table");for(;++x<v.length;)S[x]=f(v[x],_,w);return b(),S}function f(g,_,w){const v=g.children;let x=-1;const S=[],b=_.enter("tableRow");for(;++x<v.length;)S[x]=u(v[x],g,_,w);return b(),S}function m(g,_,w){let v=Mk.inlineCode(g,_,w);return w.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function yj(){return{exit:{taskListCheckValueChecked:qC,taskListCheckValueUnchecked:qC,paragraph:bj}}}function _j(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vj}}}function qC(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function bj(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const i=t.children[0];if(i&&i.type==="text"){const r=e.children;let a=-1,l;for(;++a<r.length;){const o=r[a];if(o.type==="paragraph"){l=o;break}}l===t&&(i.value=i.value.slice(1),i.value.length===0?t.children.shift():t.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,t.position.start=Object.assign({},i.position.start)))}}this.exit(n)}function vj(n,e,t,i){const r=n.children[0],a=typeof n.checked=="boolean"&&r&&r.type==="paragraph",l="["+(n.checked?"x":" ")+"] ",o=t.createTracker(i);a&&o.move(l);let u=Mk.listItem(n,e,t,{...i,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),u;function h(p){return p+l}}function xj(){return[Q9(),v7(),C7(),uj(),yj()]}function Sj(n){return{extensions:[e7(),x7(n),E7(),gj(n),_j()]}}const wj={tokenize:Mj,partial:!0},Rk={tokenize:Rj,partial:!0},Ok={tokenize:Oj,partial:!0},Nk={tokenize:Nj,partial:!0},Cj={tokenize:Dj,partial:!0},Dk={name:"wwwAutolink",tokenize:Aj,previous:Lk},Ik={name:"protocolAutolink",tokenize:Tj,previous:Bk},qa={name:"emailAutolink",tokenize:kj,previous:zk},na={};function Ej(){return{text:na}}let vl=48;for(;vl<123;)na[vl]=qa,vl++,vl===58?vl=65:vl===91&&(vl=97);na[43]=qa;na[45]=qa;na[46]=qa;na[95]=qa;na[72]=[qa,Ik];na[104]=[qa,Ik];na[87]=[qa,Dk];na[119]=[qa,Dk];function kj(n,e,t){const i=this;let r,a;return l;function l(f){return!k0(f)||!zk.call(i,i.previous)||Vb(i.events)?t(f):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(f))}function o(f){return k0(f)?(n.consume(f),o):f===64?(n.consume(f),u):t(f)}function u(f){return f===46?n.check(Cj,p,h)(f):f===45||f===95||Yi(f)?(a=!0,n.consume(f),u):p(f)}function h(f){return n.consume(f),r=!0,u}function p(f){return a&&r&&ar(i.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),e(f)):t(f)}}function Aj(n,e,t){const i=this;return r;function r(l){return l!==87&&l!==119||!Lk.call(i,i.previous)||Vb(i.events)?t(l):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(wj,n.attempt(Rk,n.attempt(Ok,a),t),t)(l))}function a(l){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),e(l)}}function Tj(n,e,t){const i=this;let r="",a=!1;return l;function l(f){return(f===72||f===104)&&Bk.call(i,i.previous)&&!Vb(i.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),n.consume(f),o):t(f)}function o(f){if(ar(f)&&r.length<5)return r+=String.fromCodePoint(f),n.consume(f),o;if(f===58){const m=r.toLowerCase();if(m==="http"||m==="https")return n.consume(f),u}return t(f)}function u(f){return f===47?(n.consume(f),a?h:(a=!0,u)):t(f)}function h(f){return f===null||Jp(f)||jn(f)||Al(f)||xm(f)?t(f):n.attempt(Rk,n.attempt(Ok,p),t)(f)}function p(f){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),e(f)}}function Mj(n,e,t){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,n.consume(l),r):l===46&&i===3?(n.consume(l),a):t(l)}function a(l){return l===null?t(l):e(l)}}function Rj(n,e,t){let i,r,a;return l;function l(h){return h===46||h===95?n.check(Nk,u,o)(h):h===null||jn(h)||Al(h)||h!==45&&xm(h)?u(h):(a=!0,n.consume(h),l)}function o(h){return h===95?i=!0:(r=i,i=void 0),n.consume(h),l}function u(h){return r||i||!a?t(h):e(h)}}function Oj(n,e){let t=0,i=0;return r;function r(l){return l===40?(t++,n.consume(l),r):l===41&&i<t?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?n.check(Nk,e,a)(l):l===null||jn(l)||Al(l)?e(l):(n.consume(l),r)}function a(l){return l===41&&i++,n.consume(l),r}}function Nj(n,e,t){return i;function i(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),i):o===38?(n.consume(o),a):o===93?(n.consume(o),r):o===60||o===null||jn(o)||Al(o)?e(o):t(o)}function r(o){return o===null||o===40||o===91||jn(o)||Al(o)?e(o):i(o)}function a(o){return ar(o)?l(o):t(o)}function l(o){return o===59?(n.consume(o),i):ar(o)?(n.consume(o),l):t(o)}}function Dj(n,e,t){return i;function i(a){return n.consume(a),r}function r(a){return Yi(a)?t(a):e(a)}}function Lk(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||jn(n)}function Bk(n){return!ar(n)}function zk(n){return!(n===47||k0(n))}function k0(n){return n===43||n===45||n===46||n===95||Yi(n)}function Vb(n){let e=n.length,t=!1;for(;e--;){const i=n[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){t=!0;break}if(i._gfmAutolinkLiteralWalkedInto){t=!1;break}}return n.length>0&&!t&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Ij={tokenize:Hj,partial:!0};function Lj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Fj,continuation:{tokenize:jj},exit:Uj}},text:{91:{name:"gfmFootnoteCall",tokenize:Pj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Bj,resolveTo:zj}}}}function Bj(n,e,t){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const u=i.events[r][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!l||!l._balanced)return t(u);const h=Ss(i.sliceSerialize({start:l.end,end:i.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?t(u):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),e(u))}}function zj(n,e){let t=n.length;for(;t--;)if(n[t][1].type==="labelImage"&&n[t][0]==="enter"){n[t][1];break}n[t+1][1].type="data",n[t+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},n[t+3][1].start),end:Object.assign({},n[n.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},n[t+3][1].end),end:Object.assign({},n[t+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},n[n.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[n[t+1],n[t+2],["enter",i,e],n[t+3],n[t+4],["enter",r,e],["exit",r,e],["enter",a,e],["enter",l,e],["exit",l,e],["exit",a,e],n[n.length-2],n[n.length-1],["exit",i,e]];return n.splice(t,n.length-t+1,...o),n}function Pj(n,e,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,l;return o;function o(f){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?t(f):(n.enter("gfmFootnoteCallMarker"),n.consume(f),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(f){if(a>999||f===93&&!l||f===null||f===91||jn(f))return t(f);if(f===93){n.exit("chunkString");const m=n.exit("gfmFootnoteCallString");return r.includes(Ss(i.sliceSerialize(m)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(f),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),e):t(f)}return jn(f)||(l=!0),a++,n.consume(f),f===92?p:h}function p(f){return f===91||f===92||f===93?(n.consume(f),a++,h):h(f)}}function Fj(n,e,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,o;return u;function u(_){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(_){return _===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):t(_)}function p(_){if(l>999||_===93&&!o||_===null||_===91||jn(_))return t(_);if(_===93){n.exit("chunkString");const w=n.exit("gfmFootnoteDefinitionLabelString");return a=Ss(i.sliceSerialize(w)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(_),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),m}return jn(_)||(o=!0),l++,n.consume(_),_===92?f:p}function f(_){return _===91||_===92||_===93?(n.consume(_),l++,p):p(_)}function m(_){return _===58?(n.enter("definitionMarker"),n.consume(_),n.exit("definitionMarker"),r.includes(a)||r.push(a),mn(n,g,"gfmFootnoteDefinitionWhitespace")):t(_)}function g(_){return e(_)}}function jj(n,e,t){return n.check(ud,e,n.attempt(Ij,e,t))}function Uj(n){n.exit("gfmFootnoteDefinition")}function Hj(n,e,t){const i=this;return mn(n,r,"gfmFootnoteDefinitionIndent",5);function r(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(a):t(a)}}function qj(n){let t=(n||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return t==null&&(t=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,o){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let h=u;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[u][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[u][1].end)},f={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[u][1].start)},m=[["enter",p,o],["enter",l[h][1],o],["exit",l[h][1],o],["enter",f,o]],g=o.parser.constructs.insideSpan.null;g&&Lr(m,m.length,0,Sm(g,l.slice(h+1,u),o)),Lr(m,m.length,0,[["exit",f,o],["enter",l[u][1],o],["exit",l[u][1],o],["exit",p,o]]),Lr(l,h-1,u-h+3,m),u=h+m.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function a(l,o,u){const h=this.previous,p=this.events;let f=0;return m;function m(_){return h===126&&p[p.length-1][1].type!=="characterEscape"?u(_):(l.enter("strikethroughSequenceTemporary"),g(_))}function g(_){const w=au(h);if(_===126)return f>1?u(_):(l.consume(_),f++,g);if(f<2&&!t)return u(_);const v=l.exit("strikethroughSequenceTemporary"),x=au(_);return v._open=!x||x===2&&!!w,v._close=!w||w===2&&!!x,o(_)}}}class Vj{constructor(){this.map=[]}add(e,t,i){Wj(this,e,t,i)}consume(e){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const i=[];for(;t>0;)t-=1,i.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const a of r)e.push(a);r=i.pop()}this.map.length=0}}function Wj(n,e,t,i){let r=0;if(!(t===0&&i.length===0)){for(;r<n.map.length;){if(n.map[r][0]===e){n.map[r][1]+=t,n.map[r][2].push(...i);return}r+=1}n.map.push([e,t,i])}}function $j(n,e){let t=!1;const i=[];for(;e<n.length;){const r=n[e];if(t){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(n[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(n[e-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(t=!0);e+=1}return i}function Gj(){return{flow:{null:{name:"table",tokenize:Kj,resolveAll:Yj}}}}function Kj(n,e,t){const i=this;let r=0,a=0,l;return o;function o(U){let Y=i.events.length-1;for(;Y>-1;){const J=i.events[Y][1].type;if(J==="lineEnding"||J==="linePrefix")Y--;else break}const K=Y>-1?i.events[Y][1].type:null,H=K==="tableHead"||K==="tableRow"?M:u;return H===M&&i.parser.lazy[i.now().line]?t(U):H(U)}function u(U){return n.enter("tableHead"),n.enter("tableRow"),h(U)}function h(U){return U===124||(l=!0,a+=1),p(U)}function p(U){return U===null?t(U):It(U)?a>1?(a=0,i.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(U),n.exit("lineEnding"),g):t(U):cn(U)?mn(n,p,"whitespace")(U):(a+=1,l&&(l=!1,r+=1),U===124?(n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),l=!0,p):(n.enter("data"),f(U)))}function f(U){return U===null||U===124||jn(U)?(n.exit("data"),p(U)):(n.consume(U),U===92?m:f)}function m(U){return U===92||U===124?(n.consume(U),f):f(U)}function g(U){return i.interrupt=!1,i.parser.lazy[i.now().line]?t(U):(n.enter("tableDelimiterRow"),l=!1,cn(U)?mn(n,_,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):_(U))}function _(U){return U===45||U===58?v(U):U===124?(l=!0,n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),w):O(U)}function w(U){return cn(U)?mn(n,v,"whitespace")(U):v(U)}function v(U){return U===58?(a+=1,l=!0,n.enter("tableDelimiterMarker"),n.consume(U),n.exit("tableDelimiterMarker"),x):U===45?(a+=1,x(U)):U===null||It(U)?C(U):O(U)}function x(U){return U===45?(n.enter("tableDelimiterFiller"),S(U)):O(U)}function S(U){return U===45?(n.consume(U),S):U===58?(l=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(U),n.exit("tableDelimiterMarker"),b):(n.exit("tableDelimiterFiller"),b(U))}function b(U){return cn(U)?mn(n,C,"whitespace")(U):C(U)}function C(U){return U===124?_(U):U===null||It(U)?!l||r!==a?O(U):(n.exit("tableDelimiterRow"),n.exit("tableHead"),e(U)):O(U)}function O(U){return t(U)}function M(U){return n.enter("tableRow"),D(U)}function D(U){return U===124?(n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),D):U===null||It(U)?(n.exit("tableRow"),e(U)):cn(U)?mn(n,D,"whitespace")(U):(n.enter("data"),N(U))}function N(U){return U===null||U===124||jn(U)?(n.exit("data"),D(U)):(n.consume(U),U===92?B:N)}function B(U){return U===92||U===124?(n.consume(U),N):N(U)}}function Yj(n,e){let t=-1,i=!0,r=0,a=[0,0,0,0],l=[0,0,0,0],o=!1,u=0,h,p,f;const m=new Vj;for(;++t<n.length;){const g=n[t],_=g[1];g[0]==="enter"?_.type==="tableHead"?(o=!1,u!==0&&(VC(m,e,u,h,p),p=void 0,u=0),h={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(t,0,[["enter",h,e]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(i=!0,f=void 0,a=[0,0,0,0],l=[0,t+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(t,0,[["enter",p,e]])),r=_.type==="tableDelimiterRow"?2:p?3:1):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],f=bp(m,e,a,r,void 0,f),a=[0,0,0,0]),l[2]=t)):_.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],f=bp(m,e,a,r,void 0,f)),a=l,l=[a[1],t,0,0])):_.type==="tableHead"?(o=!0,u=t):_.type==="tableRow"||_.type==="tableDelimiterRow"?(u=t,a[1]!==0?(l[0]=l[1],f=bp(m,e,a,r,t,f)):l[1]!==0&&(f=bp(m,e,l,r,t,f)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&VC(m,e,u,h,p),m.consume(e.events),t=-1;++t<e.events.length;){const g=e.events[t];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=$j(e.events,t))}return n}function bp(n,e,t,i,r,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(a.end=Object.assign({},Gc(e.events,t[0])),n.add(t[0],0,[["exit",a,e]]));const u=Gc(e.events,t[1]);if(a={type:l,start:Object.assign({},u),end:Object.assign({},u)},n.add(t[1],0,[["enter",a,e]]),t[2]!==0){const h=Gc(e.events,t[2]),p=Gc(e.events,t[3]),f={type:o,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(t[2],0,[["enter",f,e]]),i!==2){const m=e.events[t[2]],g=e.events[t[3]];if(m[1].end=Object.assign({},g[1].end),m[1].type="chunkText",m[1].contentType="text",t[3]>t[2]+1){const _=t[2]+1,w=t[3]-t[2]-1;n.add(_,w,[])}}n.add(t[3]+1,0,[["exit",f,e]])}return r!==void 0&&(a.end=Object.assign({},Gc(e.events,r)),n.add(r,0,[["exit",a,e]]),a=void 0),a}function VC(n,e,t,i,r){const a=[],l=Gc(e.events,t);r&&(r.end=Object.assign({},l),a.push(["exit",r,e])),i.end=Object.assign({},l),a.push(["exit",i,e]),n.add(t+1,0,a)}function Gc(n,e){const t=n[e],i=t[0]==="enter"?"start":"end";return t[1][i]}const Xj={name:"tasklistCheck",tokenize:Jj};function Zj(){return{text:{91:Xj}}}function Jj(n,e,t){const i=this;return r;function r(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?t(u):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),a)}function a(u){return jn(u)?(n.enter("taskListCheckValueUnchecked"),n.consume(u),n.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(n.enter("taskListCheckValueChecked"),n.consume(u),n.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),o):t(u)}function o(u){return It(u)?e(u):cn(u)?n.check({tokenize:Qj},e,t)(u):t(u)}}function Qj(n,e,t){return mn(n,i,"whitespace");function i(r){return r===null?t(r):e(r)}}function eU(n){return K2([Ej(),Lj(),qj(n),Gj(),Zj()])}const tU={};function nU(n){const e=this,t=n||tU,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(eU(t)),a.push(xj()),l.push(Sj(t))}const WC=(function(n,e,t){const i=hd(t);if(!n||!n.type||!n.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=n.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<n.children.length;)if(i(n.children[e],e,n))return n.children[e]}),Nl=(function(n){if(n==null)return sU;if(typeof n=="string")return rU(n);if(typeof n=="object")return iU(n);if(typeof n=="function")return Wb(n);throw new Error("Expected function, string, or array as `test`")});function iU(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=Nl(n[t]);return Wb(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function rU(n){return Wb(e);function e(t){return t.tagName===n}}function Wb(n){return e;function e(t,i,r){return!!(aU(t)&&n.call(this,t,typeof i=="number"?i:void 0,r||void 0))}}function sU(n){return!!(n&&typeof n=="object"&&"type"in n&&n.type==="element"&&"tagName"in n&&typeof n.tagName=="string")}function aU(n){return n!==null&&typeof n=="object"&&"type"in n&&"tagName"in n}const $C=/\n/g,GC=/[\t ]+/g,A0=Nl("br"),KC=Nl(pU),oU=Nl("p"),YC=Nl("tr"),lU=Nl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fU,mU]),Pk=Nl(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function cU(n,e){const t=e||{},i="children"in n?n.children:[],r=Pk(n),a=Uk(n,{whitespace:t.whitespace||"normal"}),l=[];(n.type==="text"||n.type==="comment")&&l.push(...jk(n,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<i.length;)l.push(...Fk(i[o],n,{whitespace:a,breakBefore:o?void 0:r,breakAfter:o<i.length-1?A0(i[o+1]):r}));const u=[];let h;for(o=-1;++o<l.length;){const p=l[o];typeof p=="number"?h!==void 0&&p>h&&(h=p):p&&(h!==void 0&&h>-1&&u.push(`
85
+ `.repeat(h)||" "),h=-1,u.push(p))}return u.join("")}function Fk(n,e,t){return n.type==="element"?uU(n,e,t):n.type==="text"?t.whitespace==="normal"?jk(n,t):hU(n):[]}function uU(n,e,t){const i=Uk(n,t),r=n.children||[];let a=-1,l=[];if(lU(n))return l;let o,u;for(A0(n)||YC(n)&&WC(e,n,YC)?u=`
86
+ `:oU(n)?(o=2,u=2):Pk(n)&&(o=1,u=1);++a<r.length;)l=l.concat(Fk(r[a],n,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?A0(r[a+1]):u}));return KC(n)&&WC(e,n,KC)&&l.push(" "),o&&l.unshift(o),u&&l.push(u),l}function jk(n,e){const t=String(n.value),i=[],r=[];let a=0;for(;a<=t.length;){$C.lastIndex=a;const u=$C.exec(t),h=u&&"index"in u?u.index:t.length;i.push(dU(t.slice(a,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?e.breakBefore:!0,h===t.length?e.breakAfter:!0)),a=h+1}let l=-1,o;for(;++l<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(r.push(i[l]),o=void 0):i[l]?(typeof o=="number"&&r.push(o),r.push(i[l]),o=0):(l===0||l===i.length-1)&&r.push(0);return r}function hU(n){return[String(n.value)]}function dU(n,e,t){const i=[];let r=0,a;for(;r<n.length;){GC.lastIndex=r;const l=GC.exec(n);a=l?l.index:n.length,!r&&!a&&l&&!e&&i.push(""),r!==a&&i.push(n.slice(r,a)),r=l?a+l[0].length:a}return r!==a&&!t&&i.push(""),i.join(" ")}function Uk(n,e){if(n.type==="element"){const t=n.properties||{};switch(n.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function fU(n){return!!(n.properties||{}).hidden}function pU(n){return n.tagName==="td"||n.tagName==="th"}function mU(n){return n.tagName==="dialog"&&!(n.properties||{}).open}function gU(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:w,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},O={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},M=[O,f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:M.concat([{begin:/\(/,end:/\)/,keywords:C,contains:M.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,N,O,M,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yU(n){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=gU(n),i=t.keywords;return i.type=[...i.type,...e.type],i.literal=[...i.literal,...e.literal],i.built_in=[...i.built_in,...e.built_in],i._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function _U(n){const e=n.regex,t={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},a=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,r]};r.contains.push(o);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},p={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],x={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:v,built_in:[...S,...b,"set","shopt",...C,...O]},contains:[g,n.SHEBANG(),_,f,a,l,x,o,u,h,p,t]}}function bU(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:x.concat([{begin:/\(/,end:/\)/,keywords:v,contains:x.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"</",contains:[].concat(S,b,x,[f,{begin:n.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:f,strings:h,keywords:v}}}function vU(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},p={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(r)+n.IDENT_RE,relevance:0},g=e.optional(r)+n.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:w,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},O={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},M=[O,f,o,t,n.C_BLOCK_COMMENT_MODE,p,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:M.concat([{begin:/\(/,end:/\)/,keywords:C,contains:M.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+l+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,p]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,h,p,o,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,h,p,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,N,O,M,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function xU(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:r.concat(a),built_in:e,literal:i},o=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},p={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=n.inherit(p,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:l},g=n.inherit(m,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},v=n.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});m.contains=[w,_,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,u,n.C_BLOCK_COMMENT_MODE],g.contains=[v,_,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,u,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const x={variants:[h,w,_,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},x,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[x,u,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},C]}}const SU=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),wU=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CU=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],EU=[...wU,...CU],kU=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),AU=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),TU=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),MU=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function RU(n){const e=n.regex,t=SU(n),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",o=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,i,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AU.join("|")+")"},{begin:":(:)?("+TU.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+MU.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:kU.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+EU.join("|")+")\\b"}]}}function OU(n){const e=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function NU(n){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"string",variants:[n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[n.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}function DU(n){const e=n.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[n.HASH_COMMENT_MODE,n.QUOTE_STRING_MODE,n.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(t,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function IU(n){const e=n.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:n.NUMBER_RE}]},i=n.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[i,a,r,l,t,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,p=/'[^']*'/,f=e.either(u,h,p),m=e.concat(f,"(\\s*\\.\\s*",f,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:m,className:"attr",starts:{end:/$/,contains:[i,o,a,r,l,t]}}]}}var Kc="[0-9](_*[0-9])*",vp=`\\.(${Kc})`,xp="[0-9a-fA-F](_*[0-9a-fA-F])*",XC={className:"number",variants:[{begin:`(\\b(${Kc})((${vp})|\\.)?|(${vp}))[eE][+-]?(${Kc})[fFdD]?\\b`},{begin:`\\b(${Kc})((${vp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${vp})[fFdD]?\\b`},{begin:`\\b(${Kc})[fFdD]\\b`},{begin:`\\b0[xX]((${xp})\\.?|(${xp})?\\.(${xp}))[pP][+-]?(${Kc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${xp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Hk(n,e,t){return t===-1?"":n.replace(e,i=>Hk(n,e,t-1))}function LU(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=t+Hk("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[p,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[h,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,XC,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},XC,h]}}const ZC="[A-Za-z$_][0-9A-Za-z$_]*",BU=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zU=["true","false","null","undefined","NaN","Infinity"],qk=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Vk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],PU=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],FU=[].concat(Wk,qk,Vk);function jU(n){const e=n.regex,t=(ne,{after:P})=>{const L="</"+ne[0].slice(1);return ne.input.indexOf(L,P)!==-1},i=ZC,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,P)=>{const L=ne[0].length+ne.index,F=ne.input[L];if(F==="<"||F===","){P.ignoreMatch();return}F===">"&&(t(ne,{after:L})||P.ignoreMatch());let $;const W=ne.input.substring(L);if($=W.match(/^\s*=/)){P.ignoreMatch();return}if(($=W.match(/^\s+extends\s+/))&&$.index===0){P.ignoreMatch();return}}},o={$pattern:ZC,keyword:BU,literal:zU,built_in:FU,"variable.language":PU},u="[0-9](_?[0-9])*",h=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},S={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},b=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,{match:/\$\d+/},f];m.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const C=[].concat(S,m.contains),O=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(C)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O},D={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...qk,...Vk]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function K(ne){return e.concat("(?!",ne.join("|"),")")}const H={match:e.concat(/\b/,K([...Wk,"super","import"].map(ne=>`${ne}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,S,{match:/\$\d+/},f,N,{scope:"attr",match:i+e.lookahead(":"),relevance:0},ie,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:Z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,Y,D,Q,{match:/\$[(.]/}]}}function UU(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,t,n.QUOTE_STRING_MODE,r,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Yc="[0-9](_*[0-9])*",Sp=`\\.(${Yc})`,wp="[0-9a-fA-F](_*[0-9a-fA-F])*",HU={className:"number",variants:[{begin:`(\\b(${Yc})((${Sp})|\\.)?|(${Sp}))[eE][+-]?(${Yc})[fFdD]?\\b`},{begin:`\\b(${Yc})((${Sp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Sp})[fFdD]?\\b`},{begin:`\\b(${Yc})[fFdD]\\b`},{begin:`\\b0[xX]((${wp})\\.?|(${wp})?\\.(${wp}))[pP][+-]?(${Yc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${wp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qU(n){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,r]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,a,r]}]};r.contains.push(l);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(l,{className:"string"}),"self"]}]},h=HU,p=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=f;return m.variants[1].contains=[f],f.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,p,t,i,o,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,n.C_LINE_COMMENT_MODE,p],relevance:0},n.C_LINE_COMMENT_MODE,p,o,u,l,n.C_NUMBER_MODE]},p]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,u]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
87
+ `},h]}}const VU=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WU=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],$U=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GU=[...WU,...$U],KU=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$k=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Gk=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YU=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),XU=$k.concat(Gk).sort().reverse();function ZU(n){const e=VU(n),t=XU,i="and or not only",r="[\\w-]+",a="("+r+"|@\\{"+r+"\\})",l=[],o=[],u=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},h=function(b,C,O){return{className:b,begin:C,relevance:O}},p={$pattern:/[a-z-]+/,keyword:i,attribute:KU.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:p,relevance:0};o.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,f,h("variable","@@?"+r,10),h("variable","@\\{"+r+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const m=o.concat({begin:/\{/,end:/\}/,contains:l}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},_={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YU.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:p,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:m}},x={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,g,h("keyword","all\\b"),h("variable","@\\{"+r+"\\}"),{begin:"\\b("+GU.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,h("selector-tag",a,0),h("selector-id","#"+a),h("selector-class","\\."+a,0),h("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+$k.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Gk.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},S={begin:r+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[x]};return l.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,w,v,S,_,x,g,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function JU(n){const e="\\[=*\\[",t="\\]=*\\]",i={begin:e,end:t,contains:["self"]},r=[n.COMMENT("--(?!"+e+")","$"),n.COMMENT("--"+e,t,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:n.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[n.inherit(n.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},n.C_NUMBER_MODE,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[i],relevance:5}])}}function QU(n){const e={className:"variable",variants:[{begin:"\\$\\("+n.UNDERSCORE_IDENT_RE+"\\)",contains:[n.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,e]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,t]},r={begin:"^"+n.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[n.HASH_COMMENT_MODE,e,t,i,r,a,l]}}function eH(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=n.inherit(h,{contains:[]}),m=n.inherit(p,{contains:[]});h.contains.push(m),p.contains.push(f);let g=[t,u];return[h,p,f,m].forEach(x=>{x.contains=x.contains.concat(g)}),g=g.concat(h,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,a,h,p,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},r,i,u,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tH(n){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"</",contains:[e,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}function nH(n){const e=n.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:t.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},l={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},p=[n.BACKSLASH_ESCAPE,a,u],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(w,v,x="\\1")=>{const S=x==="\\1"?x:e.concat(x,v);return e.concat(e.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,S,/(?:\\.|[^\\\/])*?/,x,i)},g=(w,v,x)=>e.concat(e.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,x,i),_=[u,n.HASH_COMMENT_MODE,n.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:p,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+n.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[n.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",e.either(...f,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:g("(?:m|qr)?",/\//,/\//)},{begin:g("m|qr",e.either(...f,{capture:!0}),/\1/)},{begin:g("m|qr",/\(/,/\)/)},{begin:g("m|qr",/\[/,/\]/)},{begin:g("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,o,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=_,l.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:_}}function iH(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),a=e.concat(/[A-Z]+/,t),l={scope:"variable",match:"\\$+"+i},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=n.inherit(n.APOS_STRING_MODE,{illegal:null}),p=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(u)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(J,Q)=>{Q.data._beginMatch=J[1]||J[2]},"on:end":(J,Q)=>{Q.data._beginMatch!==J[1]&&Q.ignoreMatch()}},m=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),g=`[
88
+ ]`,_={scope:"string",variants:[p,h,f,m]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],x=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:x,literal:(J=>{const Q=[];return J.forEach(Z=>{Q.push(Z),Z.toLowerCase()===Z?Q.push(Z.toUpperCase()):Q.push(Z.toLowerCase())}),Q})(v),built_in:S},O=J=>J.map(Q=>Q.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,e.concat(g,"+"),e.concat("(?!",O(S).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(i,"\\b(?!\\()"),N={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},B={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},U={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[B,l,N,n.C_BLOCK_COMMENT_MODE,_,w,M]},Y={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",O(x).join("\\b|"),"|",O(S).join("\\b|"),"\\b)"),i,e.concat(g,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[U]};U.contains.push(Y);const K=[B,N,n.C_BLOCK_COMMENT_MODE,_,w,M],H={begin:e.concat(/#\[\s*\\?/,e.either(r,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...K]},...K,{scope:"meta",variants:[{match:r},{match:a}]}]};return{case_insensitive:!1,keywords:C,contains:[H,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},l,Y,N,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",H,l,N,n.C_BLOCK_COMMENT_MODE,_,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},_,w]}}function rH(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function sH(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aH(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},p={begin:/\{\{/,relevance:0},f={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u,p,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u,p,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,p,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,p,h]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,_=`\\b|${i.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${_})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${m})[jJ](?=${_})`}]},v={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",u,w,f,n.HASH_COMMENT_MODE]}]};return h.contains=[f,w,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[u,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,x,f]}]}}function oH(n){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function lH(n){const e=n.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[n.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),n.HASH_COMMENT_MODE,{scope:"string",contains:[n.BACKSLASH_ESCAPE],variants:[n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[a,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function cH(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=e.concat(i,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},h=[n.COMMENT("#","$",{contains:[o]}),n.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],p={className:"subst",begin:/#\{/,end:/\}/,keywords:l},f={className:"string",contains:[n.BACKSLASH_ESCAPE,p],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,p]})]}]},m="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},M=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:l},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:t}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,p],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,h),relevance:0}].concat(u,h);p.contains=M,w.contains=M;const U=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:M}}];return h.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(U).concat(h).concat(M)}}function uH(n){const e=n.regex,t=/(r#)?/,i=e.concat(t,n.UNDERSCORE_IDENT_RE),r=e.concat(t,n.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,e.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:p,keyword:o,literal:u,built_in:h},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:p}},{className:"punctuation",begin:"->"},a]}}const hH=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dH=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fH=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],pH=[...dH,...fH],mH=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),gH=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yH=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_H=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function bH(n){const e=hH(n),t=yH,i=gH,r="@[a-z-]+",a="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+pH.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_H.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:mH.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function vH(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xH(n){const e=n.regex,t=n.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=p,_=[...h,...u].filter(O=>!p.includes(O)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function S(O){return e.concat(/\b/,e.either(...O.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:S(m),relevance:0};function C(O,{exceptions:M,when:D}={}){const N=D;return M=M||[],O.map(B=>B.match(/\|\d+$/)||M.includes(B)?B:N(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:C(_,{when:O=>O.length<3}),literal:a,type:o,built_in:f},contains:[{scope:"type",match:S(l)},b,x,w,i,r,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,v]}}function Kk(n){return n?typeof n=="string"?n:n.source:null}function Mh(n){return zn("(?=",n,")")}function zn(...n){return n.map(t=>Kk(t)).join("")}function SH(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function ir(...n){return"("+(SH(n).capture?"":"?:")+n.map(i=>Kk(i)).join("|")+")"}const $b=n=>zn(/\b/,n,/\w$/.test(n)?/\b/:/\B/),wH=["Protocol","Type"].map($b),JC=["init","self"].map($b),CH=["Any","Self"],z_=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QC=["false","nil","true"],EH=["assignment","associativity","higherThan","left","lowerThan","none","right"],kH=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],eE=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Yk=ir(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Xk=ir(Yk,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),P_=zn(Yk,Xk,"*"),Zk=ir(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),nm=ir(Zk,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Vs=zn(Zk,nm,"*"),Cp=zn(/[A-Z]/,nm,"*"),AH=["attached","autoclosure",zn(/convention\(/,ir("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",zn(/objc\(/,Vs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],TH=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function MH(n){const e={match:/\s+/,relevance:0},t=n.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[n.C_LINE_COMMENT_MODE,t],r={match:[/\./,ir(...wH,...JC)],className:{2:"keyword"}},a={match:zn(/\./,ir(...z_)),relevance:0},l=z_.filter(ze=>typeof ze=="string").concat(["_|0"]),o=z_.filter(ze=>typeof ze!="string").concat(CH).map($b),u={variants:[{className:"keyword",match:ir(...o,...JC)}]},h={$pattern:ir(/\b\w+/,/#\w+/),keyword:l.concat(kH),literal:QC},p=[r,a,u],f={match:zn(/\./,ir(...eE)),relevance:0},m={className:"built_in",match:zn(/\b/,ir(...eE),/(?=\()/)},g=[f,m],_={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:P_},{match:`\\.(\\.|${Xk})+`}]},v=[_,w],x="([0-9]_*)+",S="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${x})(\\.(${x}))?([eE][+-]?(${x}))?\\b`},{match:`\\b0x(${S})(\\.(${S}))?([pP][+-]?(${x}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},C=(ze="")=>({className:"subst",variants:[{match:zn(/\\/,ze,/[0\\tnr"']/)},{match:zn(/\\/,ze,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(ze="")=>({className:"subst",match:zn(/\\/,ze,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(ze="")=>({className:"subst",label:"interpol",begin:zn(/\\/,ze,/\(/),end:/\)/}),D=(ze="")=>({begin:zn(ze,/"""/),end:zn(/"""/,ze),contains:[C(ze),O(ze),M(ze)]}),N=(ze="")=>({begin:zn(ze,/"/),end:zn(/"/,ze),contains:[C(ze),M(ze)]}),B={className:"string",variants:[D(),D("#"),D("##"),D("###"),N(),N("#"),N("##"),N("###")]},U=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],Y={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U},K=ze=>{const Ue=zn(ze,/\//),at=zn(/\//,ze);return{begin:Ue,end:at,contains:[...U,{scope:"comment",begin:`#(?!.*${at})`,end:/$/}]}},H={scope:"regexp",variants:[K("###"),K("##"),K("#"),Y]},J={match:zn(/`/,Vs,/`/)},Q={className:"variable",match:/\$\d+/},Z={className:"variable",match:`\\$${nm}+`},ie=[J,Q,Z],ne={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:TH,contains:[...v,b,B]}]}},P={scope:"keyword",match:zn(/@/,ir(...AH),Mh(ir(/\(/,/\s+/)))},L={scope:"meta",match:zn(/@/,Vs)},F=[ne,P,L],$={match:Mh(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:zn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,nm,"+")},{className:"type",match:Cp,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:zn(/\s+&\s+/,Mh(Cp)),relevance:0}]},W={begin:/</,end:/>/,keywords:h,contains:[...i,...p,...F,_,$]};$.contains.push(W);const ye={match:zn(Vs,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ye,...i,H,...p,...g,...v,b,B,...ie,...F,$]},Ne={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,$]},le={begin:ir(Mh(zn(Vs,/\s*:/)),Mh(zn(Vs,/\s+/,Vs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Vs}]},ee={begin:/\(/,end:/\)/,keywords:h,contains:[le,...i,...p,...v,b,B,...F,$,be],endsParent:!0,illegal:/["']/},Ce={match:[/(func|macro)/,/\s+/,ir(J.match,Vs,P_)],className:{1:"keyword",3:"title.function"},contains:[Ne,ee,e],illegal:[/\[/,/%/]},xe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ne,ee,e],illegal:/\[|%/},Ze={match:[/operator/,/\s+/,P_],className:{1:"keyword",3:"title"}},De={begin:[/precedencegroup/,/\s+/,Cp],className:{1:"keyword",3:"title"},contains:[$],keywords:[...EH,...QC],end:/}/},wt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Fe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},qe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Vs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[Ne,...p,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Cp},...p],relevance:0}]};for(const ze of B.variants){const Ue=ze.contains.find(Lt=>Lt.label==="interpol");Ue.keywords=h;const at=[...p,...g,...v,b,B,...ie];Ue.contains=[...at,{begin:/\(/,end:/\)/,contains:["self",...at]}]}return{name:"Swift",keywords:h,contains:[...i,Ce,xe,wt,Fe,qe,Ze,De,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},H,...p,...g,...v,b,B,...ie,...F,$,be]}}const im="[A-Za-z$_][0-9A-Za-z$_]*",Jk=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Qk=["true","false","null","undefined","NaN","Infinity"],eA=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],tA=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nA=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],iA=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rA=[].concat(nA,eA,tA);function RH(n){const e=n.regex,t=(ne,{after:P})=>{const L="</"+ne[0].slice(1);return ne.input.indexOf(L,P)!==-1},i=im,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,P)=>{const L=ne[0].length+ne.index,F=ne.input[L];if(F==="<"||F===","){P.ignoreMatch();return}F===">"&&(t(ne,{after:L})||P.ignoreMatch());let $;const W=ne.input.substring(L);if($=W.match(/^\s*=/)){P.ignoreMatch();return}if(($=W.match(/^\s+extends\s+/))&&$.index===0){P.ignoreMatch();return}}},o={$pattern:im,keyword:Jk,literal:Qk,built_in:rA,"variable.language":iA},u="[0-9](_?[0-9])*",h=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},S={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},b=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,{match:/\$\d+/},f];m.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const C=[].concat(S,m.contains),O=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(C)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O},D={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...eA,...tA]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function K(ne){return e.concat("(?!",ne.join("|"),")")}const H={match:e.concat(/\b/,K([...nA,"super","import"].map(ne=>`${ne}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,w,v,S,{match:/\$\d+/},f,N,{scope:"attr",match:i+e.lookahead(":"),relevance:0},ie,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:Z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,Y,D,Q,{match:/\$[(.]/}]}}function OH(n){const e=n.regex,t=RH(n),i=im,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:im,keyword:Jk.concat(u),literal:Qk,built_in:rA.concat(r),"variable.language":iA},p={className:"meta",begin:"@"+i},f=(w,v,x)=>{const S=w.contains.findIndex(b=>b.label===v);if(S===-1)throw new Error("can not find mode to replace");w.contains.splice(S,1,x)};Object.assign(t.keywords,h),t.exports.PARAMS_CONTAINS.push(p);const m=t.contains.find(w=>w.scope==="attr"),g=Object.assign({},m,{match:e.concat(i,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,m,g]),t.contains=t.contains.concat([p,a,l,g]),f(t,"shebang",n.SHEBANG()),f(t,"use_strict",o);const _=t.contains.find(w=>w.label==="func.def");return _.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function NH(n){const e=n.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,r),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,e.either(a,r),/ +/,e.either(l,o),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},p={className:"label",begin:/^\w+:/},f=n.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=n.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,i,u,h,p,f,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function DH(n){n.regex;const e=n.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=n.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,l,r,n.QUOTE_STRING_MODE,u,h,o]}}function IH(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=n.inherit(a,{begin:/\(/,end:/\)/}),o=n.inherit(n.APOS_STRING_MODE,{className:"string"}),u=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,o,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,l,u,o]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:h}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function LH(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,r]},o=n.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},_={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},m,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},_,w,a,l],x=[...v];return x.pop(),x.push(o),g.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const BH={arduino:yU,bash:_U,c:bU,cpp:vU,csharp:xU,css:RU,diff:OU,go:NU,graphql:DU,ini:IU,java:LU,javascript:jU,json:UU,kotlin:qU,less:ZU,lua:JU,makefile:QU,markdown:eH,objectivec:tH,perl:nH,php:iH,"php-template":rH,plaintext:sH,python:aH,"python-repl":oH,r:lH,ruby:cH,rust:uH,scss:bH,shell:vH,sql:xH,swift:MH,typescript:OH,vbnet:NH,wasm:DH,xml:IH,yaml:LH};var F_,tE;function zH(){if(tE)return F_;tE=1;function n(oe){return oe instanceof Map?oe.clear=oe.delete=oe.set=function(){throw new Error("map is read-only")}:oe instanceof Set&&(oe.add=oe.clear=oe.delete=function(){throw new Error("set is read-only")}),Object.freeze(oe),Object.getOwnPropertyNames(oe).forEach(Be=>{const ot=oe[Be],Ft=typeof ot;(Ft==="object"||Ft==="function")&&!Object.isFrozen(ot)&&n(ot)}),oe}class e{constructor(Be){Be.data===void 0&&(Be.data={}),this.data=Be.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(oe){return oe.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(oe,...Be){const ot=Object.create(null);for(const Ft in oe)ot[Ft]=oe[Ft];return Be.forEach(function(Ft){for(const _n in Ft)ot[_n]=Ft[_n]}),ot}const r="</span>",a=oe=>!!oe.scope,l=(oe,{prefix:Be})=>{if(oe.startsWith("language:"))return oe.replace("language:","language-");if(oe.includes(".")){const ot=oe.split(".");return[`${Be}${ot.shift()}`,...ot.map((Ft,_n)=>`${Ft}${"_".repeat(_n+1)}`)].join(" ")}return`${Be}${oe}`};class o{constructor(Be,ot){this.buffer="",this.classPrefix=ot.classPrefix,Be.walk(this)}addText(Be){this.buffer+=t(Be)}openNode(Be){if(!a(Be))return;const ot=l(Be.scope,{prefix:this.classPrefix});this.span(ot)}closeNode(Be){a(Be)&&(this.buffer+=r)}value(){return this.buffer}span(Be){this.buffer+=`<span class="${Be}">`}}const u=(oe={})=>{const Be={children:[]};return Object.assign(Be,oe),Be};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Be){this.top.children.push(Be)}openNode(Be){const ot=u({scope:Be});this.add(ot),this.stack.push(ot)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Be){return this.constructor._walk(Be,this.rootNode)}static _walk(Be,ot){return typeof ot=="string"?Be.addText(ot):ot.children&&(Be.openNode(ot),ot.children.forEach(Ft=>this._walk(Be,Ft)),Be.closeNode(ot)),Be}static _collapse(Be){typeof Be!="string"&&Be.children&&(Be.children.every(ot=>typeof ot=="string")?Be.children=[Be.children.join("")]:Be.children.forEach(ot=>{h._collapse(ot)}))}}class p extends h{constructor(Be){super(),this.options=Be}addText(Be){Be!==""&&this.add(Be)}startScope(Be){this.openNode(Be)}endScope(){this.closeNode()}__addSublanguage(Be,ot){const Ft=Be.root;ot&&(Ft.scope=`language:${ot}`),this.add(Ft)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(oe){return oe?typeof oe=="string"?oe:oe.source:null}function m(oe){return w("(?=",oe,")")}function g(oe){return w("(?:",oe,")*")}function _(oe){return w("(?:",oe,")?")}function w(...oe){return oe.map(ot=>f(ot)).join("")}function v(oe){const Be=oe[oe.length-1];return typeof Be=="object"&&Be.constructor===Object?(oe.splice(oe.length-1,1),Be):{}}function x(...oe){return"("+(v(oe).capture?"":"?:")+oe.map(Ft=>f(Ft)).join("|")+")"}function S(oe){return new RegExp(oe.toString()+"|").exec("").length-1}function b(oe,Be){const ot=oe&&oe.exec(Be);return ot&&ot.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(oe,{joinWith:Be}){let ot=0;return oe.map(Ft=>{ot+=1;const _n=ot;let fn=f(Ft),_t="";for(;fn.length>0;){const dt=C.exec(fn);if(!dt){_t+=fn;break}_t+=fn.substring(0,dt.index),fn=fn.substring(dt.index+dt[0].length),dt[0][0]==="\\"&&dt[1]?_t+="\\"+String(Number(dt[1])+_n):(_t+=dt[0],dt[0]==="("&&ot++)}return _t}).map(Ft=>`(${Ft})`).join(Be)}const M=/\b\B/,D="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",K="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",H=(oe={})=>{const Be=/^#![ ]*\//;return oe.binary&&(oe.begin=w(Be,/.*\b/,oe.binary,/\b.*/)),i({scope:"meta",begin:Be,end:/$/,relevance:0,"on:begin":(ot,Ft)=>{ot.index!==0&&Ft.ignoreMatch()}},oe)},J={begin:"\\\\[\\s\\S]",relevance:0},Q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},Z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ne=function(oe,Be,ot={}){const Ft=i({scope:"comment",begin:oe,end:Be,contains:[]},ot);Ft.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const _n=x("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ft.contains.push({begin:w(/[ ]+/,"(",_n,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ft},P=ne("//","$"),L=ne("/\\*","\\*/"),F=ne("#","$"),$={scope:"number",begin:B,relevance:0},W={scope:"number",begin:U,relevance:0},ye={scope:"number",begin:Y,relevance:0},be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},Ne={scope:"title",begin:D,relevance:0},le={scope:"title",begin:N,relevance:0},ee={begin:"\\.\\s*"+N,relevance:0};var xe=Object.freeze({__proto__:null,APOS_STRING_MODE:Q,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:Y,COMMENT:ne,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:P,C_NUMBER_MODE:W,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(oe){return Object.assign(oe,{"on:begin":(Be,ot)=>{ot.data._beginMatch=Be[1]},"on:end":(Be,ot)=>{ot.data._beginMatch!==Be[1]&&ot.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:D,MATCH_NOTHING_RE:M,METHOD_GUARD:ee,NUMBER_MODE:$,NUMBER_RE:B,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:Z,REGEXP_MODE:be,RE_STARTERS_RE:K,SHEBANG:H,TITLE_MODE:Ne,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:le});function Ze(oe,Be){oe.input[oe.index-1]==="."&&Be.ignoreMatch()}function De(oe,Be){oe.className!==void 0&&(oe.scope=oe.className,delete oe.className)}function wt(oe,Be){Be&&oe.beginKeywords&&(oe.begin="\\b("+oe.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",oe.__beforeBegin=Ze,oe.keywords=oe.keywords||oe.beginKeywords,delete oe.beginKeywords,oe.relevance===void 0&&(oe.relevance=0))}function Fe(oe,Be){Array.isArray(oe.illegal)&&(oe.illegal=x(...oe.illegal))}function qe(oe,Be){if(oe.match){if(oe.begin||oe.end)throw new Error("begin & end are not supported with match");oe.begin=oe.match,delete oe.match}}function ze(oe,Be){oe.relevance===void 0&&(oe.relevance=1)}const Ue=(oe,Be)=>{if(!oe.beforeMatch)return;if(oe.starts)throw new Error("beforeMatch cannot be used with starts");const ot=Object.assign({},oe);Object.keys(oe).forEach(Ft=>{delete oe[Ft]}),oe.keywords=ot.keywords,oe.begin=w(ot.beforeMatch,m(ot.begin)),oe.starts={relevance:0,contains:[Object.assign(ot,{endsParent:!0})]},oe.relevance=0,delete ot.beforeMatch},at=["of","and","for","in","not","or","if","then","parent","list","value"],Lt="keyword";function St(oe,Be,ot=Lt){const Ft=Object.create(null);return typeof oe=="string"?_n(ot,oe.split(" ")):Array.isArray(oe)?_n(ot,oe):Object.keys(oe).forEach(function(fn){Object.assign(Ft,St(oe[fn],Be,fn))}),Ft;function _n(fn,_t){Be&&(_t=_t.map(dt=>dt.toLowerCase())),_t.forEach(function(dt){const ut=dt.split("|");Ft[ut[0]]=[fn,Tt(ut[0],ut[1])]})}}function Tt(oe,Be){return Be?Number(Be):Re(oe)?0:1}function Re(oe){return at.includes(oe.toLowerCase())}const He={},st=oe=>{console.error(oe)},kt=(oe,...Be)=>{console.log(`WARN: ${oe}`,...Be)},_e=(oe,Be)=>{He[`${oe}/${Be}`]||(console.log(`Deprecated as of ${oe}. ${Be}`),He[`${oe}/${Be}`]=!0)},Ve=new Error;function ft(oe,Be,{key:ot}){let Ft=0;const _n=oe[ot],fn={},_t={};for(let dt=1;dt<=Be.length;dt++)_t[dt+Ft]=_n[dt],fn[dt+Ft]=!0,Ft+=S(Be[dt-1]);oe[ot]=_t,oe[ot]._emit=fn,oe[ot]._multi=!0}function Et(oe){if(Array.isArray(oe.begin)){if(oe.skip||oe.excludeBegin||oe.returnBegin)throw st("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ve;if(typeof oe.beginScope!="object"||oe.beginScope===null)throw st("beginScope must be object"),Ve;ft(oe,oe.begin,{key:"beginScope"}),oe.begin=O(oe.begin,{joinWith:""})}}function Pt(oe){if(Array.isArray(oe.end)){if(oe.skip||oe.excludeEnd||oe.returnEnd)throw st("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ve;if(typeof oe.endScope!="object"||oe.endScope===null)throw st("endScope must be object"),Ve;ft(oe,oe.end,{key:"endScope"}),oe.end=O(oe.end,{joinWith:""})}}function Tn(oe){oe.scope&&typeof oe.scope=="object"&&oe.scope!==null&&(oe.beginScope=oe.scope,delete oe.scope)}function Ht(oe){Tn(oe),typeof oe.beginScope=="string"&&(oe.beginScope={_wrap:oe.beginScope}),typeof oe.endScope=="string"&&(oe.endScope={_wrap:oe.endScope}),Et(oe),Pt(oe)}function Pn(oe){function Be(_t,dt){return new RegExp(f(_t),"m"+(oe.case_insensitive?"i":"")+(oe.unicodeRegex?"u":"")+(dt?"g":""))}class ot{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(dt,ut){ut.position=this.position++,this.matchIndexes[this.matchAt]=ut,this.regexes.push([ut,dt]),this.matchAt+=S(dt)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const dt=this.regexes.map(ut=>ut[1]);this.matcherRe=Be(O(dt,{joinWith:"|"}),!0),this.lastIndex=0}exec(dt){this.matcherRe.lastIndex=this.lastIndex;const ut=this.matcherRe.exec(dt);if(!ut)return null;const nn=ut.findIndex((ur,rs)=>rs>0&&ur!==void 0),Hn=this.matchIndexes[nn];return ut.splice(0,nn),Object.assign(ut,Hn)}}class Ft{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(dt){if(this.multiRegexes[dt])return this.multiRegexes[dt];const ut=new ot;return this.rules.slice(dt).forEach(([nn,Hn])=>ut.addRule(nn,Hn)),ut.compile(),this.multiRegexes[dt]=ut,ut}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(dt,ut){this.rules.push([dt,ut]),ut.type==="begin"&&this.count++}exec(dt){const ut=this.getMatcher(this.regexIndex);ut.lastIndex=this.lastIndex;let nn=ut.exec(dt);if(this.resumingScanAtSamePosition()&&!(nn&&nn.index===this.lastIndex)){const Hn=this.getMatcher(0);Hn.lastIndex=this.lastIndex+1,nn=Hn.exec(dt)}return nn&&(this.regexIndex+=nn.position+1,this.regexIndex===this.count&&this.considerAll()),nn}}function _n(_t){const dt=new Ft;return _t.contains.forEach(ut=>dt.addRule(ut.begin,{rule:ut,type:"begin"})),_t.terminatorEnd&&dt.addRule(_t.terminatorEnd,{type:"end"}),_t.illegal&&dt.addRule(_t.illegal,{type:"illegal"}),dt}function fn(_t,dt){const ut=_t;if(_t.isCompiled)return ut;[De,qe,Ht,Ue].forEach(Hn=>Hn(_t,dt)),oe.compilerExtensions.forEach(Hn=>Hn(_t,dt)),_t.__beforeBegin=null,[wt,Fe,ze].forEach(Hn=>Hn(_t,dt)),_t.isCompiled=!0;let nn=null;return typeof _t.keywords=="object"&&_t.keywords.$pattern&&(_t.keywords=Object.assign({},_t.keywords),nn=_t.keywords.$pattern,delete _t.keywords.$pattern),nn=nn||/\w+/,_t.keywords&&(_t.keywords=St(_t.keywords,oe.case_insensitive)),ut.keywordPatternRe=Be(nn,!0),dt&&(_t.begin||(_t.begin=/\B|\b/),ut.beginRe=Be(ut.begin),!_t.end&&!_t.endsWithParent&&(_t.end=/\B|\b/),_t.end&&(ut.endRe=Be(ut.end)),ut.terminatorEnd=f(ut.end)||"",_t.endsWithParent&&dt.terminatorEnd&&(ut.terminatorEnd+=(_t.end?"|":"")+dt.terminatorEnd)),_t.illegal&&(ut.illegalRe=Be(_t.illegal)),_t.contains||(_t.contains=[]),_t.contains=[].concat(..._t.contains.map(function(Hn){return Vn(Hn==="self"?_t:Hn)})),_t.contains.forEach(function(Hn){fn(Hn,ut)}),_t.starts&&fn(_t.starts,dt),ut.matcher=_n(ut),ut}if(oe.compilerExtensions||(oe.compilerExtensions=[]),oe.contains&&oe.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return oe.classNameAliases=i(oe.classNameAliases||{}),fn(oe)}function Un(oe){return oe?oe.endsWithParent||Un(oe.starts):!1}function Vn(oe){return oe.variants&&!oe.cachedVariants&&(oe.cachedVariants=oe.variants.map(function(Be){return i(oe,{variants:null},Be)})),oe.cachedVariants?oe.cachedVariants:Un(oe)?i(oe,{starts:oe.starts?i(oe.starts):null}):Object.isFrozen(oe)?i(oe):oe}var et="11.11.1";class Fi extends Error{constructor(Be,ot){super(Be),this.name="HTMLInjectionError",this.html=ot}}const Jn=t,ia=i,rt=Symbol("nomatch"),ks=7,As=function(oe){const Be=Object.create(null),ot=Object.create(null),Ft=[];let _n=!0;const fn="Could not find the language '{}', did you forget to load/include a language module?",_t={disableAutodetect:!0,name:"Plain text",contains:[]};let dt={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function ut(Xe){return dt.noHighlightRe.test(Xe)}function nn(Xe){let vt=Xe.className+" ";vt+=Xe.parentNode?Xe.parentNode.className:"";const Jt=dt.languageDetectRe.exec(vt);if(Jt){const pn=xi(Jt[1]);return pn||(kt(fn.replace("{}",Jt[1])),kt("Falling back to no-highlight mode for this block.",Xe)),pn?Jt[1]:"no-highlight"}return vt.split(/\s+/).find(pn=>ut(pn)||xi(pn))}function Hn(Xe,vt,Jt){let pn="",Yn="";typeof vt=="object"?(pn=Xe,Jt=vt.ignoreIllegals,Yn=vt.language):(_e("10.7.0","highlight(lang, code, ...args) has been deprecated."),_e("10.7.0",`Please use highlight(code, options) instead.
89
+ https://github.com/highlightjs/highlight.js/issues/2277`),Yn=Xe,pn=vt),Jt===void 0&&(Jt=!0);const Dt={code:pn,language:Yn};jr("before:highlight",Dt);const Ui=Dt.result?Dt.result:ur(Dt.language,Dt.code,Jt);return Ui.code=Dt.code,jr("after:highlight",Ui),Ui}function ur(Xe,vt,Jt,pn){const Yn=Object.create(null);function Dt(tt,yt){return tt.keywords[yt]}function Ui(){if(!Rt.keywords){Ot.addText(bn);return}let tt=0;Rt.keywordPatternRe.lastIndex=0;let yt=Rt.keywordPatternRe.exec(bn),qt="";for(;yt;){qt+=bn.substring(tt,yt.index);const rn=ri.case_insensitive?yt[0].toLowerCase():yt[0],Yt=Dt(Rt,rn);if(Yt){const[ti,us]=Yt;if(Ot.addText(qt),qt="",Yn[rn]=(Yn[rn]||0)+1,Yn[rn]<=ks&&(Rs+=us),ti.startsWith("_"))qt+=yt[0];else{const Os=ri.classNameAliases[ti]||ti;Si(yt[0],Os)}}else qt+=yt[0];tt=Rt.keywordPatternRe.lastIndex,yt=Rt.keywordPatternRe.exec(bn)}qt+=bn.substring(tt),Ot.addText(qt)}function Ii(){if(bn==="")return;let tt=null;if(typeof Rt.subLanguage=="string"){if(!Be[Rt.subLanguage]){Ot.addText(bn);return}tt=ur(Rt.subLanguage,bn,!0,Il[Rt.subLanguage]),Il[Rt.subLanguage]=tt._top}else tt=ss(bn,Rt.subLanguage.length?Rt.subLanguage:null);Rt.relevance>0&&(Rs+=tt.relevance),Ot.__addSublanguage(tt._emitter,tt.language)}function kn(){Rt.subLanguage!=null?Ii():Ui(),bn=""}function Si(tt,yt){tt!==""&&(Ot.startScope(yt),Ot.addText(tt),Ot.endScope())}function Uo(tt,yt){let qt=1;const rn=yt.length-1;for(;qt<=rn;){if(!tt._emit[qt]){qt++;continue}const Yt=ri.classNameAliases[tt[qt]]||tt[qt],ti=yt[qt];Yt?Si(ti,Yt):(bn=ti,Ui(),bn=""),qt++}}function ra(tt,yt){return tt.scope&&typeof tt.scope=="string"&&Ot.openNode(ri.classNameAliases[tt.scope]||tt.scope),tt.beginScope&&(tt.beginScope._wrap?(Si(bn,ri.classNameAliases[tt.beginScope._wrap]||tt.beginScope._wrap),bn=""):tt.beginScope._multi&&(Uo(tt.beginScope,yt),bn="")),Rt=Object.create(tt,{parent:{value:Rt}}),Rt}function Wa(tt,yt,qt){let rn=b(tt.endRe,qt);if(rn){if(tt["on:end"]){const Yt=new e(tt);tt["on:end"](yt,Yt),Yt.isMatchIgnored&&(rn=!1)}if(rn){for(;tt.endsParent&&tt.parent;)tt=tt.parent;return tt}}if(tt.endsWithParent)return Wa(tt.parent,yt,qt)}function gn(tt){return Rt.matcher.regexIndex===0?(bn+=tt[0],1):(er=!0,0)}function sa(tt){const yt=tt[0],qt=tt.rule,rn=new e(qt),Yt=[qt.__beforeBegin,qt["on:begin"]];for(const ti of Yt)if(ti&&(ti(tt,rn),rn.isMatchIgnored))return gn(yt);return qt.skip?bn+=yt:(qt.excludeBegin&&(bn+=yt),kn(),!qt.returnBegin&&!qt.excludeBegin&&(bn=yt)),ra(qt,tt),qt.returnBegin?0:yt.length}function hi(tt){const yt=tt[0],qt=vt.substring(tt.index),rn=Wa(Rt,tt,qt);if(!rn)return rt;const Yt=Rt;Rt.endScope&&Rt.endScope._wrap?(kn(),Si(yt,Rt.endScope._wrap)):Rt.endScope&&Rt.endScope._multi?(kn(),Uo(Rt.endScope,tt)):Yt.skip?bn+=yt:(Yt.returnEnd||Yt.excludeEnd||(bn+=yt),kn(),Yt.excludeEnd&&(bn=yt));do Rt.scope&&Ot.closeNode(),!Rt.skip&&!Rt.subLanguage&&(Rs+=Rt.relevance),Rt=Rt.parent;while(Rt!==rn.parent);return rn.starts&&ra(rn.starts,tt),Yt.returnEnd?0:yt.length}function Ur(){const tt=[];for(let yt=Rt;yt!==ri;yt=yt.parent)yt.scope&&tt.unshift(yt.scope);tt.forEach(yt=>Ot.openNode(yt))}let os={};function Ms(tt,yt){const qt=yt&&yt[0];if(bn+=tt,qt==null)return kn(),0;if(os.type==="begin"&&yt.type==="end"&&os.index===yt.index&&qt===""){if(bn+=vt.slice(yt.index,yt.index+1),!_n){const rn=new Error(`0 width match regex (${Xe})`);throw rn.languageName=Xe,rn.badRule=os.rule,rn}return 1}if(os=yt,yt.type==="begin")return sa(yt);if(yt.type==="illegal"&&!Jt){const rn=new Error('Illegal lexeme "'+qt+'" for mode "'+(Rt.scope||"<unnamed>")+'"');throw rn.mode=Rt,rn}else if(yt.type==="end"){const rn=hi(yt);if(rn!==rt)return rn}if(yt.type==="illegal"&&qt==="")return bn+=`
90
+ `,1;if(wi>1e5&&wi>yt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return bn+=qt,qt.length}const ri=xi(Xe);if(!ri)throw st(fn.replace("{}",Xe)),new Error('Unknown language: "'+Xe+'"');const Ho=Pn(ri);let ls="",Rt=pn||Ho;const Il={},Ot=new dt.__emitter(dt);Ur();let bn="",Rs=0,cs=0,wi=0,er=!1;try{if(ri.__emitTokens)ri.__emitTokens(vt,Ot);else{for(Rt.matcher.considerAll();;){wi++,er?er=!1:Rt.matcher.considerAll(),Rt.matcher.lastIndex=cs;const tt=Rt.matcher.exec(vt);if(!tt)break;const yt=vt.substring(cs,tt.index),qt=Ms(yt,tt);cs=tt.index+qt}Ms(vt.substring(cs))}return Ot.finalize(),ls=Ot.toHTML(),{language:Xe,value:ls,relevance:Rs,illegal:!1,_emitter:Ot,_top:Rt}}catch(tt){if(tt.message&&tt.message.includes("Illegal"))return{language:Xe,value:Jn(vt),illegal:!0,relevance:0,_illegalBy:{message:tt.message,index:cs,context:vt.slice(cs-100,cs+100),mode:tt.mode,resultSoFar:ls},_emitter:Ot};if(_n)return{language:Xe,value:Jn(vt),illegal:!1,relevance:0,errorRaised:tt,_emitter:Ot,_top:Rt};throw tt}}function rs(Xe){const vt={value:Jn(Xe),illegal:!1,relevance:0,_top:_t,_emitter:new dt.__emitter(dt)};return vt._emitter.addText(Xe),vt}function ss(Xe,vt){vt=vt||dt.languages||Object.keys(Be);const Jt=rs(Xe),pn=vt.filter(xi).filter(ji).map(kn=>ur(kn,Xe,!1));pn.unshift(Jt);const Yn=pn.sort((kn,Si)=>{if(kn.relevance!==Si.relevance)return Si.relevance-kn.relevance;if(kn.language&&Si.language){if(xi(kn.language).supersetOf===Si.language)return 1;if(xi(Si.language).supersetOf===kn.language)return-1}return 0}),[Dt,Ui]=Yn,Ii=Dt;return Ii.secondBest=Ui,Ii}function Fr(Xe,vt,Jt){const pn=vt&&ot[vt]||Jt;Xe.classList.add("hljs"),Xe.classList.add(`language-${pn}`)}function Mn(Xe){let vt=null;const Jt=nn(Xe);if(ut(Jt))return;if(jr("before:highlightElement",{el:Xe,language:Jt}),Xe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Xe);return}if(Xe.children.length>0&&(dt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Xe)),dt.throwUnescapedHTML))throw new Fi("One of your code blocks includes unescaped HTML.",Xe.innerHTML);vt=Xe;const pn=vt.textContent,Yn=Jt?Hn(pn,{language:Jt,ignoreIllegals:!0}):ss(pn);Xe.innerHTML=Yn.value,Xe.dataset.highlighted="yes",Fr(Xe,Jt,Yn.language),Xe.result={language:Yn.language,re:Yn.relevance,relevance:Yn.relevance},Yn.secondBest&&(Xe.secondBest={language:Yn.secondBest.language,relevance:Yn.secondBest.relevance}),jr("after:highlightElement",{el:Xe,result:Yn,text:pn})}function Qn(Xe){dt=ia(dt,Xe)}const Di=()=>{Ji(),_e("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ts(){Ji(),_e("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dl=!1;function Ji(){function Xe(){Ji()}if(document.readyState==="loading"){Dl||window.addEventListener("DOMContentLoaded",Xe,!1),Dl=!0;return}document.querySelectorAll(dt.cssSelector).forEach(Mn)}function jo(Xe,vt){let Jt=null;try{Jt=vt(oe)}catch(pn){if(st("Language definition for '{}' could not be registered.".replace("{}",Xe)),_n)st(pn);else throw pn;Jt=_t}Jt.name||(Jt.name=Xe),Be[Xe]=Jt,Jt.rawDefinition=vt.bind(null,oe),Jt.aliases&&En(Jt.aliases,{languageName:Xe})}function Qi(Xe){delete Be[Xe];for(const vt of Object.keys(ot))ot[vt]===Xe&&delete ot[vt]}function Va(){return Object.keys(Be)}function xi(Xe){return Xe=(Xe||"").toLowerCase(),Be[Xe]||Be[ot[Xe]]}function En(Xe,{languageName:vt}){typeof Xe=="string"&&(Xe=[Xe]),Xe.forEach(Jt=>{ot[Jt.toLowerCase()]=vt})}function ji(Xe){const vt=xi(Xe);return vt&&!vt.disableAutodetect}function Ai(Xe){Xe["before:highlightBlock"]&&!Xe["before:highlightElement"]&&(Xe["before:highlightElement"]=vt=>{Xe["before:highlightBlock"](Object.assign({block:vt.el},vt))}),Xe["after:highlightBlock"]&&!Xe["after:highlightElement"]&&(Xe["after:highlightElement"]=vt=>{Xe["after:highlightBlock"](Object.assign({block:vt.el},vt))})}function ei(Xe){Ai(Xe),Ft.push(Xe)}function as(Xe){const vt=Ft.indexOf(Xe);vt!==-1&&Ft.splice(vt,1)}function jr(Xe,vt){const Jt=Xe;Ft.forEach(function(pn){pn[Jt]&&pn[Jt](vt)})}function vr(Xe){return _e("10.7.0","highlightBlock will be removed entirely in v12.0"),_e("10.7.0","Please use highlightElement now."),Mn(Xe)}Object.assign(oe,{highlight:Hn,highlightAuto:ss,highlightAll:Ji,highlightElement:Mn,highlightBlock:vr,configure:Qn,initHighlighting:Di,initHighlightingOnLoad:Ts,registerLanguage:jo,unregisterLanguage:Qi,listLanguages:Va,getLanguage:xi,registerAliases:En,autoDetection:ji,inherit:ia,addPlugin:ei,removePlugin:as}),oe.debugMode=function(){_n=!1},oe.safeMode=function(){_n=!0},oe.versionString=et,oe.regex={concat:w,lookahead:m,either:x,optional:_,anyNumberOfTimes:g};for(const Xe in xe)typeof xe[Xe]=="object"&&n(xe[Xe]);return Object.assign(oe,xe),oe},ki=As({});return ki.newInstance=()=>As({}),F_=ki,ki.HighlightJS=ki,ki.default=ki,F_}var PH=zH();const FH=id(PH),nE={},jH="hljs-";function UH(n){const e=FH.newInstance();return n&&a(n),{highlight:t,highlightAuto:i,listLanguages:r,register:a,registerAlias:l,registered:o};function t(u,h,p){const f=p||nE,m=typeof f.prefix=="string"?f.prefix:jH;if(!e.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");e.configure({__emitter:HH,classPrefix:m});const g=e.highlight(h,{ignoreIllegals:!0,language:u});if(g.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:g.errorRaised});const _=g._emitter.root,w=_.data;return w.language=g.language,w.relevance=g.relevance,_}function i(u,h){const f=(h||nE).subset||r();let m=-1,g=0,_;for(;++m<f.length;){const w=f[m];if(!e.getLanguage(w))continue;const v=t(w,u,h);v.data&&v.data.relevance!==void 0&&v.data.relevance>g&&(g=v.data.relevance,_=v)}return _||{type:"root",children:[],data:{language:void 0,relevance:g}}}function r(){return e.listLanguages()}function a(u,h){if(typeof u=="string")e.registerLanguage(u,h);else{let p;for(p in u)Object.hasOwn(u,p)&&e.registerLanguage(p,u[p])}}function l(u,h){if(typeof u=="string")e.registerAliases(typeof h=="string"?h:[...h],{languageName:u});else{let p;for(p in u)if(Object.hasOwn(u,p)){const f=u[p];e.registerAliases(typeof f=="string"?f:[...f],{languageName:p})}}}function o(u){return!!e.getLanguage(u)}}class HH{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],i=t.children[t.children.length-1];i&&i.type==="text"?i.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const i=this.stack[this.stack.length-1],r=e.root.children;t?i.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):i.children.push(...r)}openNode(e){const t=this,i=e.split(".").map(function(l,o){return o?l+"_".repeat(o):t.options.classPrefix+l}),r=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const qH={};function VH(n){const e=n||qH,t=e.aliases,i=e.detect||!1,r=e.languages||BH,a=e.plainText,l=e.prefix,o=e.subset;let u="hljs";const h=UH(r);if(t&&h.registerAlias(t),l){const p=l.indexOf("-");u=p===-1?l:l.slice(0,p)}return function(p,f){Em(p,"element",function(m,g,_){if(m.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const w=WH(m);if(w===!1||!w&&!i||w&&a&&a.includes(w))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(u)||m.properties.className.unshift(u);const v=cU(m,{whitespace:"pre"});let x;try{x=w?h.highlight(w,v,{prefix:l}):h.highlightAuto(v,{prefix:l,subset:o})}catch(S){const b=S;if(w&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+w+"`, it’s not registered",{ancestors:[_,m],cause:b,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!w&&x.data&&x.data.language&&m.properties.className.push("language-"+x.data.language),x.children.length>0&&(m.children=x.children)})}}function WH(n){const e=n.properties.className;let t=-1;if(!Array.isArray(e))return;let i;for(;++t<e.length;){const r=String(e[t]);if(r==="no-highlight"||r==="nohighlight")return!1;!i&&r.slice(0,5)==="lang-"&&(i=r.slice(5)),!i&&r.slice(0,9)==="language-"&&(i=r.slice(9))}return i}const $H="_projectTab_1tzcj_7",GH="_iconBar_1tzcj_16",KH="_iconBtn_1tzcj_25",YH="_toolbar_1tzcj_123",XH="_backBtn_1tzcj_132",ZH="_breadcrumb_1tzcj_157",JH="_breadSep_1tzcj_169",QH="_breadBtn_1tzcj_174",eq="_breadCurrent_1tzcj_189",tq="_inlineInput_1tzcj_196",nq="_inlineInputField_1tzcj_200",iq="_content_1tzcj_218",rq="_empty_1tzcj_229",sq="_fileList_1tzcj_239",aq="_fileEntry_1tzcj_244",oq="_fileIcon_1tzcj_268",lq="_fileName_1tzcj_275",cq="_fileSize_1tzcj_283",uq="_fileChevron_1tzcj_290",hq="_fileViewer_1tzcj_299",dq="_newFileEditor_1tzcj_305",fq="_newFileHeader_1tzcj_312",pq="_newFileName_1tzcj_321",mq="_newFileActions_1tzcj_330",gq="_newFileSave_1tzcj_336",yq="_newFileCancel_1tzcj_336",_q="_newFileTextarea_1tzcj_364",bq="_searchOverlay_1tzcj_385",vq="_searchModal_1tzcj_399",xq="_searchInput_1tzcj_409",Sq="_searchResults_1tzcj_424",wq="_searchHint_1tzcj_431",Cq="_searchItem_1tzcj_439",Eq="_searchItemActive_1tzcj_455",kq="_searchName_1tzcj_459",Aq="_searchPath_1tzcj_465",Tq="_markdown_1tzcj_478",Mq="_contentCol_1tzcj_780",Rq="_codeLines_1tzcj_796",Oq="_codeLine_1tzcj_796",Nq="_lineNum_1tzcj_812",Dq="_lineText_1tzcj_823",Iq="_bookmarkedLine_1tzcj_831",Lq="_iconBtnActive_1tzcj_841",Bq="_bookmarkBadge_1tzcj_847",zq="_bookmarkPanel_1tzcj_868",Pq="_bookmarkPanelHeader_1tzcj_878",Fq="_bookmarkPanelTitle_1tzcj_887",jq="_bookmarkPanelClose_1tzcj_896",Uq="_bookmarkEmpty_1tzcj_915",Hq="_bookmarkList_1tzcj_923",qq="_bookmarkItem_1tzcj_937",Vq="_bookmarkItemOther_1tzcj_948",Wq="_bookmarkItemTop_1tzcj_950",$q="_bookmarkItemLine_1tzcj_957",Gq="_bookmarkItemFile_1tzcj_965",Kq="_bookmarkItemDel_1tzcj_975",Yq="_bookmarkItemText_1tzcj_995",Xq="_bookmarkItemNote_1tzcj_1008",Zq="_subTabContainer_1tzcj_1038",Jq="_subTabBar_1tzcj_1045",Qq="_subTab_1tzcj_1038",eV="_subTabActive_1tzcj_1082",tV="_subTabLabel_1tzcj_1088",nV="_subTabClose_1tzcj_1096",iV="_subTabContent_1tzcj_1114",rV="_subTabPanel_1tzcj_1120",sV="_standalone_1tzcj_1127",aV="_standaloneHeader_1tzcj_1136",oV="_standaloneTitle_1tzcj_1146",lV="_standalonePath_1tzcj_1154",cV="_standaloneContent_1tzcj_1162",uV="_standaloneEmpty_1tzcj_1169",lt={projectTab:$H,iconBar:GH,iconBtn:KH,toolbar:YH,backBtn:XH,breadcrumb:ZH,breadSep:JH,breadBtn:QH,breadCurrent:eq,inlineInput:tq,inlineInputField:nq,content:iq,empty:rq,fileList:sq,fileEntry:aq,fileIcon:oq,fileName:lq,fileSize:cq,fileChevron:uq,fileViewer:hq,newFileEditor:dq,newFileHeader:fq,newFileName:pq,newFileActions:mq,newFileSave:gq,newFileCancel:yq,newFileTextarea:_q,searchOverlay:bq,searchModal:vq,searchInput:xq,searchResults:Sq,searchHint:wq,searchItem:Cq,searchItemActive:Eq,searchName:kq,searchPath:Aq,markdown:Tq,contentCol:Mq,codeLines:Rq,codeLine:Oq,lineNum:Nq,lineText:Dq,bookmarkedLine:Iq,iconBtnActive:Lq,bookmarkBadge:Bq,bookmarkPanel:zq,bookmarkPanelHeader:Pq,bookmarkPanelTitle:Fq,bookmarkPanelClose:jq,bookmarkEmpty:Uq,bookmarkList:Hq,bookmarkItem:qq,bookmarkItemOther:Vq,bookmarkItemTop:Wq,bookmarkItemLine:$q,bookmarkItemFile:Gq,bookmarkItemDel:Kq,bookmarkItemText:Yq,bookmarkItemNote:Xq,subTabContainer:Zq,subTabBar:Jq,subTab:Qq,subTabActive:eV,subTabLabel:tV,subTabClose:nV,subTabContent:iV,subTabPanel:rV,standalone:sV,standaloneHeader:aV,standaloneTitle:oV,standalonePath:lV,standaloneContent:cV,standaloneEmpty:uV};function iE(n){return n==null?"":n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function sA(n,e){if(e==="dir")return"📁";const t=n.split(".").pop()?.toLowerCase()??"";return{md:"📝",mdx:"📝",txt:"📄",ts:"🔵",tsx:"🔵",js:"🟡",jsx:"🟡",json:"📋",yaml:"📋",yml:"📋",toml:"📋",css:"🎨",scss:"🎨",html:"🌐",py:"🐍",go:"🐹",rs:"⚙",java:"☕",sh:"📟",bash:"📟",zsh:"📟",sql:"🗃",graphql:"🗃",svg:"🖼",png:"🖼",jpg:"🖼",gif:"🖼",env:"🔒",lock:"🔒"}[t]||"📄"}function hV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("circle",{cx:"7",cy:"7",r:"5"}),A.jsx("line",{x1:"11",y1:"11",x2:"14.5",y2:"14.5"})]})}function dV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("path",{d:"M3 1h6l4 4v10H3V1z"}),A.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"13"}),A.jsx("line",{x1:"5",y1:"10",x2:"11",y2:"10"})]})}function fV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("path",{d:"M1 3h5l2 2h7v9H1V3z"}),A.jsx("line",{x1:"8",y1:"8",x2:"8",y2:"12"}),A.jsx("line",{x1:"6",y1:"10",x2:"10",y2:"10"})]})}function pV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),A.jsx("line",{x1:"1",y1:"5.5",x2:"15",y2:"5.5"}),A.jsx("line",{x1:"5.5",y1:"5.5",x2:"5.5",y2:"14"})]})}function mV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("path",{d:"M2 8a6 6 0 0 1 10.5-4"}),A.jsx("path",{d:"M14 8a6 6 0 0 1-10.5 4"}),A.jsx("polyline",{points:"12 1 13 4 10 4.5"}),A.jsx("polyline",{points:"4 15 3 12 6 11.5"})]})}function gV(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[A.jsx("line",{x1:"2",y1:"3",x2:"14",y2:"3"}),A.jsx("line",{x1:"5",y1:"6.5",x2:"14",y2:"6.5"}),A.jsx("line",{x1:"5",y1:"10",x2:"14",y2:"10"}),A.jsx("line",{x1:"2",y1:"13.5",x2:"11",y2:"13.5"}),A.jsx("polyline",{points:"2 5.5 3.5 7 2 8.5"})]})}function yV({active:n=!1}){return A.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:n?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",children:A.jsx("path",{d:"M3 2h10v13l-5-3.5L3 15V2z",strokeLinejoin:"round"})})}function _V(n){let e=0;const t=[];return n.replace(/>\s*</g,`>
91
+ <`).split(`
92
+ `).forEach(i=>{const r=i.trim();if(!r)return;const a=/^<\/[^>]+>/.test(r),l=/\/>$/.test(r)||/^<\?/.test(r)||/^<!/.test(r),o=!a&&!l&&r.includes("</");a&&(e=Math.max(0,e-1)),t.push(" ".repeat(e)+r),!a&&!l&&!o&&/^<[^?!/]/.test(r)&&e++}),t.join(`
93
+ `)}function bV({projectPath:n,onSelect:e,onClose:t}){const[i,r]=V.useState(""),[a,l]=V.useState([]),[o,u]=V.useState(0),[h,p]=V.useState(!1),f=V.useRef(null),m=V.useRef(void 0);V.useEffect(()=>{f.current?.focus()},[]),V.useEffect(()=>{if(!i.trim()){l([]);return}return clearTimeout(m.current),m.current=setTimeout(async()=>{p(!0);try{const _=await fetch(`/api/files/search?root=${encodeURIComponent(n)}&q=${encodeURIComponent(i.trim())}`);if(_.ok){const w=await _.json();l(w.results||[]),u(0)}}catch{}p(!1)},200),()=>clearTimeout(m.current)},[i,n]);const g=V.useCallback(_=>{if(_.key==="Escape"){t();return}if(_.key==="ArrowDown"){_.preventDefault(),u(w=>Math.min(w+1,a.length-1));return}if(_.key==="ArrowUp"){_.preventDefault(),u(w=>Math.max(w-1,0));return}if(_.key==="Enter"&&a[o]){e(a[o]);return}},[a,o,e,t]);return A.jsx("div",{className:lt.searchOverlay,onClick:t,children:A.jsxs("div",{className:lt.searchModal,onClick:_=>_.stopPropagation(),children:[A.jsx("input",{ref:f,className:lt.searchInput,value:i,onChange:_=>r(_.target.value),onKeyDown:g,placeholder:"Search files by name...",spellCheck:!1}),A.jsxs("div",{className:lt.searchResults,children:[h&&A.jsx("div",{className:lt.searchHint,children:"Searching..."}),!h&&i&&a.length===0&&A.jsx("div",{className:lt.searchHint,children:"No matches"}),a.map((_,w)=>A.jsxs("button",{className:`${lt.searchItem} ${w===o?lt.searchItemActive:""}`,onClick:()=>e(_),onMouseEnter:()=>u(w),children:[A.jsx("span",{className:lt.fileIcon,children:sA(_.name,_.type)}),A.jsx("span",{className:lt.searchName,children:_.name}),A.jsx("span",{className:lt.searchPath,children:_.path})]},_.path))]})]})})}function rE({placeholder:n,onSubmit:e,onCancel:t}){const[i,r]=V.useState(""),a=V.useRef(null);V.useEffect(()=>{a.current?.focus()},[]);const l=V.useCallback(o=>{o.key==="Escape"&&t(),o.key==="Enter"&&i.trim()&&e(i.trim())},[i,e,t]);return A.jsx("div",{className:lt.inlineInput,children:A.jsx("input",{ref:a,className:lt.inlineInputField,value:i,onChange:o=>r(o.target.value),onKeyDown:l,onBlur:t,placeholder:n,spellCheck:!1})})}function vV({projectPath:n,initialPath:e,onOpenBrowserTab:t,onPathChange:i}){const[r,a]=V.useState(e||"/"),[l,o]=V.useState([]),[u,h]=V.useState(null),[p,f]=V.useState(!1),[m,g]=V.useState(null),[_,w]=V.useState([]),[v,x]=V.useState(null),[S,b]=V.useState(!1),[C,O]=V.useState(!1),[M,D]=V.useState(!1),[N,B]=V.useState(null),[U,Y]=V.useState(""),[K,H]=V.useState(.5),J=V.useRef(!1),Q=V.useRef(null),[Z,ie]=V.useState([]),[ne,P]=V.useState(!1),L=V.useRef(null),F=V.useCallback(async Re=>{f(!0),g(null),h(null),x(null),B(null);try{const He=await fetch(`/api/files/list?root=${encodeURIComponent(n)}&path=${encodeURIComponent(Re)}`);if(!He.ok){const kt=await He.json().catch(()=>({error:He.statusText}));throw new Error(kt.error||He.statusText)}const st=await He.json();o(st.items),a(Re),i?.(Re,!1)}catch(He){const st=He instanceof Error?He.message:String(He);g(st),o([])}finally{f(!1)}},[n,i]),$=V.useCallback(async Re=>{f(!0),g(null),B(null);try{const He=await fetch(`/api/files/read?root=${encodeURIComponent(n)}&path=${encodeURIComponent(Re)}`);if(!He.ok){const _e=await He.json().catch(()=>({error:He.statusText}));throw new Error(_e.error||He.statusText)}const st=await He.json();h(st),a(Re),i?.(Re,!0);const kt=Re.split("/").pop()||Re;w(_e=>_e.some(Ve=>Ve.path===Re)?_e:[..._e,{path:Re,name:kt}]),x(Re)}catch(He){const st=He instanceof Error?He.message:String(He);g(st)}finally{f(!1)}},[n,i]);V.useEffect(()=>{n&&F(e||"/")},[n]);const W=V.useMemo(()=>`agent-manager:bookmarks:${n}`,[n]);V.useEffect(()=>{try{const Re=localStorage.getItem(W);Re&&ie(JSON.parse(Re))}catch{}},[W]),V.useEffect(()=>{try{localStorage.setItem(W,JSON.stringify(Z))}catch{}},[Z,W]),V.useEffect(()=>{if(L.current!==null&&u){const Re=L.current;L.current=null,requestAnimationFrame(()=>{document.getElementById(`fv-line-${Re}`)?.scrollIntoView({behavior:"smooth",block:"center"})})}},[u]);const ye=V.useCallback(()=>{if(u||N){const He=r.split("/").filter(Boolean);He.pop(),F("/"+He.join("/"));return}if(r==="/")return;const Re=r.split("/").filter(Boolean);Re.pop(),F("/"+Re.join("/"))},[r,u,N,F]),be=V.useCallback(Re=>{const He=r==="/"?"/"+Re.name:r+"/"+Re.name;Re.type==="dir"?F(He):$(He)},[r,F,$]);V.useCallback(Re=>{x(Re.path),$(Re.path)},[$]),V.useCallback((Re,He)=>{He.stopPropagation(),w(st=>{const kt=st.filter(_e=>_e.path!==Re);if(v===Re)if(kt.length>0){const _e=kt[kt.length-1];x(_e.path),$(_e.path)}else{x(null),h(null);const _e=Re.split("/").filter(Boolean);_e.pop(),F("/"+_e.join("/"))}return kt})},[v,$,F]);const Ne=V.useCallback(Re=>{b(!1),Re.type==="dir"?F(Re.path):$(Re.path)},[F,$]),le=V.useCallback(async Re=>{O(!1);const He=r==="/"?"/"+Re:r+"/"+Re;B(He),Y(""),h(null)},[r]),ee=V.useCallback(async()=>{if(N)try{const Re=await fetch("/api/files/write",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:n,path:N,content:U})});if(!Re.ok){const He=await Re.json().catch(()=>({error:"Write failed"}));g(He.error||"Write failed");return}B(null),$(N)}catch(Re){g(Re instanceof Error?Re.message:String(Re))}},[N,U,n,$]),Ce=V.useCallback(()=>{B(null),Y("")},[]),xe=V.useCallback(async Re=>{D(!1);const He=r==="/"?"/"+Re:r+"/"+Re;try{const st=await fetch("/api/files/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:n,path:He})});if(!st.ok){const kt=await st.json().catch(()=>({error:"Mkdir failed"}));g(kt.error||"Mkdir failed");return}F(r)}catch(st){g(st instanceof Error?st.message:String(st))}},[r,n,F]),Ze=V.useCallback(()=>{u?$(r):F(r)},[r,u,F,$]),De=V.useCallback(()=>{const Re=u?r.split("/").slice(0,-1).join("/")||"/":r;t?t(n,Re):window.open(`/project-browser?path=${encodeURIComponent(n)}`,"_blank")},[n,r,u,t]),wt=V.useCallback(()=>{const Re=window.getSelection(),He=Re?.toString().trim()??"";if(u&&He&&u.content?.includes(He)){const st=u.content,kt=st.indexOf(He),_e=st.slice(0,kt).split(`
94
+ `).length,Ve=_e+He.split(`
95
+ `).length-1,ft={id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,filePath:u.path,lineStart:_e,lineEnd:Ve,selectedText:He.slice(0,300),note:""};ie(Et=>[...Et,ft]),P(!0),Re.removeAllRanges()}else P(st=>!st)},[u]),Fe=V.useCallback(Re=>{ie(He=>He.filter(st=>st.id!==Re))},[]),qe=V.useCallback((Re,He)=>{ie(st=>st.map(kt=>kt.id===Re?{...kt,note:He}:kt))},[]),ze=V.useCallback(Re=>{Re.filePath!==u?.path?(L.current=Re.lineStart,$(Re.filePath)):document.getElementById(`fv-line-${Re.lineStart}`)?.scrollIntoView({behavior:"smooth",block:"center"})},[u,$]),Ue=V.useCallback(()=>{if(!u||u.binary||!u.content)return;const Re=(u.ext??u.path.split(".").pop()??"").toLowerCase();let He=null;if(Re==="json")try{He=JSON.stringify(JSON.parse(u.content),null,2)}catch{}else(Re==="xml"||Re==="svg"||Re==="html"||Re==="xhtml")&&(He=_V(u.content));He!==null&&He!==u.content&&h({...u,content:He})},[u]);V.useCallback(Re=>{Re.preventDefault(),J.current=!0;const He=Re.clientX,st=K,kt=Q.current;if(!kt)return;const _e=kt.offsetWidth,Ve=Et=>{if(!J.current)return;const Pt=Et.clientX-He,Tn=Math.max(.2,Math.min(.8,st+Pt/_e));H(Tn)},ft=()=>{J.current=!1,document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",ft),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",ft)},[K]);const at=r.split("/").filter(Boolean),Lt=n.split("/").filter(Boolean).pop()||n,St=u&&v,Tt=N!==null;return V.useMemo(()=>{if(St||Tt){const He=(St?r:N).split("/").filter(Boolean);return He.pop(),"/"+He.join("/")}return r},[St,Tt,r,N]),A.jsxs("div",{className:lt.projectTab,children:[A.jsxs("div",{className:lt.iconBar,children:[A.jsx("button",{className:lt.iconBtn,onClick:()=>b(!0),title:"Search files (fuzzy)",children:A.jsx(hV,{})}),A.jsx("button",{className:lt.iconBtn,onClick:()=>O(!0),title:"New file",children:A.jsx(dV,{})}),A.jsx("button",{className:lt.iconBtn,onClick:()=>D(!0),title:"New folder",children:A.jsx(fV,{})}),A.jsx("button",{className:lt.iconBtn,onClick:Ze,title:"Refresh",children:A.jsx(mV,{})}),A.jsx("button",{className:lt.iconBtn,onClick:De,title:"Open project in new tab",children:A.jsx(pV,{})}),A.jsx("button",{className:lt.iconBtn,onClick:Ue,disabled:!u||!!u.binary,title:"Format file (JSON / XML)",children:A.jsx(gV,{})}),A.jsxs("button",{className:`${lt.iconBtn} ${ne||Z.length>0?lt.iconBtnActive:""}`,onClick:wt,title:"Bookmark selected text / show bookmarks",children:[A.jsx(yV,{active:Z.length>0}),Z.length>0&&A.jsx("span",{className:lt.bookmarkBadge,children:Z.length})]})]}),A.jsxs("div",{className:lt.toolbar,children:[A.jsx("button",{className:lt.backBtn,onClick:ye,disabled:r==="/"&&!u&&!N,title:"Go up",children:"←"}),A.jsxs("div",{className:lt.breadcrumb,children:[A.jsx("button",{className:lt.breadBtn,onClick:()=>{h(null),x(null),B(null),F("/")},children:Lt}),at.map((Re,He)=>{const st=He===at.length-1,kt="/"+at.slice(0,He+1).join("/");return A.jsxs("span",{children:[A.jsx("span",{className:lt.breadSep,children:"/"}),st&&!St&&!Tt?A.jsx("span",{className:lt.breadCurrent,children:Re}):A.jsx("button",{className:lt.breadBtn,onClick:()=>{h(null),x(null),B(null),F(kt)},children:Re})]},kt)})]})]}),C&&A.jsx(rE,{placeholder:"filename.ext",onSubmit:le,onCancel:()=>O(!1)}),M&&A.jsx(rE,{placeholder:"folder name",onSubmit:xe,onCancel:()=>D(!1)}),A.jsxs("div",{className:lt.contentCol,children:[A.jsxs("div",{className:lt.content,ref:Q,children:[p&&A.jsx("div",{className:lt.empty,children:"Loading..."}),m&&A.jsx("div",{className:lt.empty,style:{color:"var(--accent-red)"},children:m}),!p&&!m&&Tt&&A.jsxs("div",{className:lt.newFileEditor,children:[A.jsxs("div",{className:lt.newFileHeader,children:[A.jsx("span",{className:lt.newFileName,children:N}),A.jsxs("div",{className:lt.newFileActions,children:[A.jsx("button",{className:lt.newFileSave,onClick:ee,children:"Save"}),A.jsx("button",{className:lt.newFileCancel,onClick:Ce,children:"Cancel"})]})]}),A.jsx("textarea",{className:lt.newFileTextarea,value:U,onChange:Re=>Y(Re.target.value),placeholder:"Type file content...",autoFocus:!0,spellCheck:!1})]}),!p&&!m&&!u&&!Tt&&l.length===0&&A.jsx("div",{className:lt.empty,children:"EMPTY DIRECTORY"}),!p&&!m&&!u&&!Tt&&l.length>0&&A.jsx("div",{className:lt.fileList,children:l.map(Re=>A.jsxs("button",{className:lt.fileEntry,onClick:()=>be(Re),children:[A.jsx("span",{className:lt.fileIcon,children:sA(Re.name,Re.type)}),A.jsx("span",{className:lt.fileName,children:Re.name}),Re.type==="file"&&Re.size!=null&&A.jsx("span",{className:lt.fileSize,children:iE(Re.size)}),Re.type==="dir"&&A.jsx("span",{className:lt.fileChevron,children:"›"})]},Re.name))}),!p&&!m&&u&&!Tt&&A.jsx("div",{className:lt.fileViewer,children:u.binary?A.jsxs("div",{className:lt.empty,children:["Binary file (",iE(u.size),")"]}):u.ext==="md"||u.ext==="mdx"?A.jsx("div",{className:lt.markdown,children:A.jsx(q9,{remarkPlugins:[nU],rehypePlugins:[VH],components:{a:({children:Re,...He})=>A.jsx("a",{...He,target:"_blank",rel:"noopener noreferrer",children:Re})},children:u.content||""})}):A.jsx("div",{className:lt.codeLines,children:(u.content||"").split(`
96
+ `).map((Re,He)=>{const st=He+1,kt=Z.some(_e=>_e.filePath===u.path&&st>=_e.lineStart&&st<=_e.lineEnd);return A.jsxs("div",{id:`fv-line-${st}`,className:`${lt.codeLine}${kt?` ${lt.bookmarkedLine}`:""}`,children:[A.jsx("span",{className:lt.lineNum,children:st}),A.jsx("span",{className:lt.lineText,children:Re||" "})]},He)})})})]}),ne&&A.jsxs("div",{className:lt.bookmarkPanel,children:[A.jsxs("div",{className:lt.bookmarkPanelHeader,children:[A.jsxs("span",{className:lt.bookmarkPanelTitle,children:["BOOKMARKS (",Z.length,")"]}),A.jsx("button",{className:lt.bookmarkPanelClose,onClick:()=>P(!1),children:"✕"})]}),Z.length===0?A.jsx("div",{className:lt.bookmarkEmpty,children:"Select text in the viewer, then click the bookmark icon to add."}):A.jsx("div",{className:lt.bookmarkList,children:Z.map(Re=>A.jsxs("div",{className:`${lt.bookmarkItem}${Re.filePath!==u?.path?` ${lt.bookmarkItemOther}`:""}`,onClick:()=>ze(Re),children:[A.jsxs("div",{className:lt.bookmarkItemTop,children:[A.jsxs("span",{className:lt.bookmarkItemLine,children:["L",Re.lineStart,Re.lineEnd!==Re.lineStart?`–${Re.lineEnd}`:""]}),A.jsx("span",{className:lt.bookmarkItemFile,children:Re.filePath.split("/").pop()}),A.jsx("button",{className:lt.bookmarkItemDel,onClick:He=>{He.stopPropagation(),Fe(Re.id)},title:"Delete bookmark",children:"✕"})]}),A.jsx("div",{className:lt.bookmarkItemText,children:Re.selectedText.slice(0,120)}),A.jsx("input",{className:lt.bookmarkItemNote,placeholder:"Add note...",value:Re.note,onChange:He=>qe(Re.id,He.target.value),onClick:He=>He.stopPropagation()})]},Re.id))})]})]}),S&&A.jsx(bV,{projectPath:n,onSelect:Ne,onClose:()=>b(!1)})]})}function xV({projectPath:n}){const e=n.split("/").filter(Boolean).pop()||"project",[t,i]=V.useState(()=>[{id:"default",label:e,projectPath:n}]),[r,a]=V.useState("default"),l=V.useCallback((p,f)=>{const m=f.split("/").filter(Boolean),g=m.length>0?m[m.length-1]:p.split("/").filter(Boolean).pop()||"project",_=`sub-${Date.now()}`;i(w=>[...w,{id:_,label:g,projectPath:p,initialPath:f}]),a(_)},[]),o=V.useCallback((p,f)=>{f.stopPropagation(),i(m=>{const g=m.filter(_=>_.id!==p);if(g.length===0){const _={id:`sub-${Date.now()}`,label:e,projectPath:n};return a(_.id),[_]}return r===p&&a(g[g.length-1].id),g})},[r,e,n]),u=V.useCallback((p,f,m)=>{const g=f.split("/").filter(Boolean),_=g.length>0?g[g.length-1]:n.split("/").filter(Boolean).pop()||"project";i(w=>w.map(v=>v.id===p?{...v,label:_}:v))},[n]),h=t.length>1;return A.jsxs("div",{className:lt.subTabContainer,children:[h&&A.jsx("div",{className:lt.subTabBar,children:t.map(p=>A.jsxs("button",{className:`${lt.subTab} ${r===p.id?lt.subTabActive:""}`,onClick:()=>a(p.id),children:[A.jsx("span",{className:lt.subTabLabel,children:p.label}),A.jsx("span",{className:lt.subTabClose,onClick:f=>o(p.id,f),title:"Close tab",children:"×"})]},p.id))}),A.jsx("div",{className:lt.subTabContent,children:t.map(p=>A.jsx("div",{className:lt.subTabPanel,style:{display:r===p.id?"flex":"none"},children:A.jsx(vV,{projectPath:p.projectPath,initialPath:p.initialPath,onOpenBrowserTab:l,onPathChange:(f,m)=>u(p.id,f,m)})},p.id))})]})}const aA="session-rooms";function sE(){try{const n=localStorage.getItem(aA);if(n)return JSON.parse(n)}catch{}return[]}function Do(n){try{localStorage.setItem(aA,JSON.stringify(n))}catch{}}const Gs=Tl((n,e)=>({rooms:sE(),createRoom:t=>{const i=`room-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=e().rooms,a=new Set(r.map(u=>u.roomIndex).filter(u=>u!=null));let l=0;for(;a.has(l);)l++;const o={id:i,name:t,sessionIds:[],collapsed:!1,createdAt:Date.now(),roomIndex:l};return n(u=>{const h=[...u.rooms,o];return Do(h),{rooms:h}}),i},renameRoom:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id===t?{...l,name:i}:l);return Do(a),{rooms:a}}),deleteRoom:t=>n(i=>{const r=i.rooms.filter(a=>a.id!==t);return Do(r),{rooms:r}}),addSession:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id!==t||l.sessionIds.includes(i)?l:{...l,sessionIds:[...l.sessionIds,i]});return Do(a),{rooms:a}}),removeSession:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id!==t?l:{...l,sessionIds:l.sessionIds.filter(o=>o!==i)});return Do(a),{rooms:a}}),moveSession:(t,i,r)=>n(a=>{if(i===r)return a;const l=a.rooms.map(o=>o.id===i?{...o,sessionIds:o.sessionIds.filter(u=>u!==t)}:o.id===r?o.sessionIds.includes(t)?o:{...o,sessionIds:[...o.sessionIds,t]}:o);return Do(l),{rooms:l}}),toggleCollapse:t=>n(i=>{const r=i.rooms.map(a=>a.id===t?{...a,collapsed:!a.collapsed}:a);return Do(r),{rooms:r}}),setRoomIndex:(t,i)=>n(r=>{const a=r.rooms.map(l=>l.id===t?{...l,roomIndex:i}:l);return Do(a),{rooms:a}}),getRoomForSession:t=>e().rooms.find(i=>i.sessionIds.includes(t)),loadFromStorage:()=>{const t=sE();return n({rooms:t}),t}})),Gb="kill-confirm";function SV(){const n=bi(m=>m.activeModal),e=bi(m=>m.closeModal),t=yn(m=>m.selectedSessionId),i=yn(m=>m.sessions),r=yn(m=>m.deselectSession),[a,l]=V.useState(!1);if(!(n===Gb)||!t)return null;const u=i.get(t),h=u?.projectName||t.slice(0,8),p=()=>{e()},f=async()=>{if(!a){l(!0);try{const g=await(await fetch(`/api/sessions/${t}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})})).json();if(g.ok){if(u?.terminalId)try{await fetch(`/api/terminals/${u.terminalId}`,{method:"DELETE"})}catch{Nt("Failed to close terminal","error")}Nt(`PID ${g.pid||"N/A"} terminated`,"success"),r()}else Nt(g.error||"Kill failed","error")}catch(m){Nt(m.message,"error")}finally{l(!1),e()}}};return A.jsx("div",{className:ht.overlay,onClick:p,children:A.jsxs("div",{className:ht.panel,onClick:m=>m.stopPropagation(),children:[A.jsx("h3",{children:"Kill Session"}),A.jsxs("p",{children:['Kill session for "',h,'"? This will terminate the Claude process (SIGTERM then SIGKILL).']}),A.jsxs("div",{className:ht.actions,children:[A.jsx("button",{className:ht.closeBtn,onClick:p,style:{fontSize:"12px",padding:"6px 14px"},children:"CANCEL"}),A.jsx("button",{onClick:f,disabled:a,style:{background:"rgba(255, 51, 85, 0.15)",border:"1px solid rgba(255, 51, 85, 0.3)",color:"var(--accent-red, #ff3355)",fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:a?"not-allowed":"pointer"},children:a?"KILLING...":"KILL"})]})]})})}const Kb="alert-modal";function wV(){const n=bi(h=>h.activeModal),e=bi(h=>h.closeModal),t=yn(h=>h.selectedSessionId),[i,r]=V.useState(5);if(!(n===Kb)||!t)return null;const l=()=>{e()},o=Number.isFinite(i)&&i>=1&&i<=999,u=async()=>{if(o){e();try{const h=Date.now();await Kt.alerts.add({sessionId:t,type:"timer",message:`Alert after ${i} minutes`,createdAt:h}),Nt(`Alert set for ${i} minutes`,"success")}catch(h){Nt(h.message,"error")}}};return A.jsx("div",{className:ht.overlay,onClick:l,children:A.jsxs("div",{className:ht.panel,onClick:h=>h.stopPropagation(),children:[A.jsx("h3",{children:"Set Alert"}),A.jsx("p",{children:"Get notified after a duration of inactivity."}),A.jsxs("div",{className:ht.alertInputRow,children:[A.jsx("input",{type:"number",className:ht.alertInput,value:i,onChange:h=>r(parseInt(h.target.value,10)||0),min:1,max:999}),A.jsx("span",{children:"minutes"})]}),!o&&i!==0&&A.jsx("p",{style:{color:"#ff5555",fontSize:11,margin:"0 0 12px"},children:"Enter a value between 1 and 999"}),A.jsxs("div",{className:ht.actions,children:[A.jsx("button",{className:ht.closeBtn,onClick:l,style:{fontSize:"12px",padding:"6px 14px"},children:"CANCEL"}),A.jsx("button",{onClick:u,disabled:!o,style:{background:"rgba(255, 145, 0, 0.15)",border:"1px solid rgba(255, 145, 0, 0.3)",color:"var(--accent-orange, #ff9100)",fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:i<1?"not-allowed":"pointer"},children:"SET ALERT"})]})]})})}const Yb="summarize-modal";function CV(){const n=bi(H=>H.activeModal),e=bi(H=>H.closeModal),t=yn(H=>H.selectedSessionId),i=yn(H=>H.sessions),[r,a]=V.useState([]),[l,o]=V.useState(null),[u,h]=V.useState(!1),[p,f]=V.useState(null),[m,g]=V.useState(""),[_,w]=V.useState(""),[v,x]=V.useState(!1),S=n===Yb;V.useEffect(()=>{S&&b()},[S]);const b=V.useCallback(async()=>{const H=await Kt.summaryPrompts.toArray();a(H);const J=H.find(Q=>Q.isDefault);J?.id!=null&&o(J.id)},[]),C=()=>{e(),h(!1),f(null),g(""),w("")};if(!S||!t)return null;const O=i.get(t),M=()=>{if(!O)return"";let H=`Project: ${O.projectName||O.projectPath||"Unknown"}
97
+ `;H+=`Status: ${O.status}
98
+ `,H+=`Started: ${new Date(O.startedAt).toISOString()}
99
+ `,O.endedAt&&(H+=`Ended: ${new Date(O.endedAt).toISOString()}
100
+ `),H+=`
101
+ --- PROMPTS ---
102
+ `;for(const J of O.promptHistory||[])H+=`[${new Date(J.timestamp).toISOString()}] ${J.text}
103
+
104
+ `;H+=`
105
+ --- TOOL CALLS ---
106
+ `;for(const J of O.toolLog||[])H+=`[${new Date(J.timestamp).toISOString()}] ${J.tool}: ${J.input||""}
107
+ `;H+=`
108
+ --- RESPONSES ---
109
+ `;for(const J of O.responseLog||[])H+=`[${new Date(J.timestamp).toISOString()}] ${J.text||""}
110
+
111
+ `;return H},D=async(H,J)=>{if(v)return;const Q=t;x(!0),C();try{const Z=M();let ie=J||"";if(!ie&&H){const L=await Kt.summaryPrompts.get(H);L&&(ie=L.prompt)}const P=await(await fetch(`/api/sessions/${Q}/summarize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:Z,promptTemplate:ie})})).json();if(P.ok){const F=yn.getState().selectedSessionId===Q?"AI summary generated & session archived":`Summary generated for session ${Q?.slice(0,8)}`;Nt(F,"success")}else Nt(P.error||"Summarize failed","error")}catch(Z){Nt(Z.message,"error")}finally{x(!1)}},N=async H=>{const J=await Kt.summaryPrompts.toArray();for(const Q of J)Q.isDefault&&Q.id!==H&&await Kt.summaryPrompts.update(Q.id,{isDefault:0});await Kt.summaryPrompts.update(H,{isDefault:1}),await b(),Nt("Default prompt set","success")},B=H=>{f(H.id??null),g(H.name),w(H.prompt),h(!0)},U=async H=>{await Kt.summaryPrompts.delete(H),await b(),Nt("Prompt template removed","info")},Y=async()=>{const H=m.trim(),J=_.trim();if(!H||!J){Nt("Name and prompt are required","warning");return}const Q=Date.now();p!=null?(await Kt.summaryPrompts.update(p,{name:H,prompt:J,updatedAt:Q}),Nt("Template updated","success")):(await Kt.summaryPrompts.add({name:H,prompt:J,isDefault:0,createdAt:Q,updatedAt:Q}),Nt("Template saved","success")),h(!1),f(null),g(""),w(""),await b()},K=()=>{const H=_.trim();if(!H){Nt("Write a prompt first","warning");return}D(null,H)};return A.jsx("div",{className:ht.overlay,onClick:C,children:A.jsxs("div",{className:ht.panel,style:{maxWidth:"520px"},onClick:H=>H.stopPropagation(),children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[A.jsx("h3",{children:"Summarize Session"}),A.jsx("button",{className:ht.closeBtn,onClick:C,children:"×"})]}),A.jsxs("div",{style:{maxHeight:"240px",overflowY:"auto",marginBottom:"12px"},children:[r.length===0&&A.jsx("p",{style:{textAlign:"center",color:"var(--text-dim)",fontSize:"11px"},children:"No prompt templates yet. Create one below."}),r.map(H=>A.jsxs("div",{onClick:()=>o(H.id??null),style:{padding:"10px 12px",marginBottom:"6px",border:`1px solid ${l===H.id?"var(--accent-cyan)":"var(--border-subtle)"}`,borderRadius:"6px",background:l===H.id?"rgba(0, 229, 255, 0.08)":"transparent",cursor:"pointer",transition:"all 0.15s"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[A.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--text-primary)"},children:H.name}),H.isDefault?A.jsx("span",{style:{fontSize:"9px",fontWeight:700,letterSpacing:"1px",padding:"1px 6px",borderRadius:"3px",color:"var(--accent-cyan)",background:"rgba(0, 229, 255, 0.1)"},children:"DEFAULT"}):null,A.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"4px"},children:[A.jsx("button",{onClick:J=>{J.stopPropagation(),N(H.id)},title:"Set as default",style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"★"}),A.jsx("button",{onClick:J=>{J.stopPropagation(),B(H)},title:"Edit",style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"✎"}),A.jsx("button",{onClick:J=>{J.stopPropagation(),U(H.id)},title:"Delete",style:{background:"none",border:"none",color:"var(--accent-red)",cursor:"pointer",fontSize:"14px",padding:"2px"},children:"×"})]})]}),A.jsxs("div",{style:{fontSize:"11px",color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[H.prompt.substring(0,150),H.prompt.length>150?"...":""]})]},H.id))]}),u&&A.jsxs("div",{style:{marginBottom:"12px",padding:"12px",border:"1px solid var(--border-subtle)",borderRadius:"6px"},children:[A.jsx("input",{type:"text",placeholder:"Template name",value:m,onChange:H=>g(H.target.value),style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"6px 8px",borderRadius:"4px",marginBottom:"8px",outline:"none"}}),A.jsx("textarea",{placeholder:"Write your summary prompt...",value:_,onChange:H=>w(H.target.value),rows:4,style:{width:"100%",background:"var(--bg-card)",border:"1px solid var(--border-accent)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"12px",padding:"8px",borderRadius:"4px",resize:"vertical",outline:"none"}}),A.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"8px",justifyContent:"flex-end"},children:[A.jsx("button",{onClick:Y,style:{background:"rgba(0, 229, 255, 0.12)",border:"1px solid rgba(0, 229, 255, 0.3)",color:"var(--accent-cyan)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"4px 10px",borderRadius:"4px",cursor:"pointer"},children:p!=null?"UPDATE":"SAVE"}),A.jsx("button",{onClick:K,style:{background:"rgba(255, 204, 0, 0.12)",border:"1px solid rgba(255, 204, 0, 0.3)",color:"#ffcc00",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"4px 10px",borderRadius:"4px",cursor:"pointer"},children:"USE ONCE"})]})]}),A.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[A.jsx("button",{onClick:()=>{h(!u),u&&(f(null),g(""),w(""))},style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:600,letterSpacing:"0.5px",padding:"6px 12px",borderRadius:"4px",cursor:"pointer"},children:u?"HIDE FORM":"CUSTOM PROMPT"}),A.jsx("button",{onClick:()=>D(l,null),disabled:!l||v,style:{background:l?"rgba(255, 204, 0, 0.15)":"transparent",border:"1px solid rgba(255, 204, 0, 0.3)",color:"#ffcc00",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:700,letterSpacing:"1px",padding:"6px 14px",borderRadius:"4px",cursor:l&&!v?"pointer":"not-allowed",opacity:l?1:.5},children:v?"SUMMARIZING...":"SUMMARIZE"})]})]})})}const oA=["ONEOFF","HEAVY","IMPORTANT"],EV={ONEOFF:"#ff9100",HEAVY:"#ff3355",IMPORTANT:"#aa66ff"},T0="session-labels";function kV(){try{return JSON.parse(localStorage.getItem(T0)||"[]").filter(e=>!oA.includes(e)).slice(0,5)}catch{return[]}}function AV(n){try{const e=JSON.parse(localStorage.getItem(T0)||"[]"),t=e.indexOf(n);t!==-1&&e.splice(t,1),e.unshift(n),localStorage.setItem(T0,JSON.stringify(e.slice(0,30)))}catch{}}function TV({sessionId:n,currentLabel:e}){const t=yn(h=>h.updateSession),i=yn(h=>h.sessions),[r,a]=V.useState(e),l=kV(),o=[...oA,...l],u=V.useCallback(async h=>{const p=r===h?"":h;a(p);const f=i.get(n);f&&t({...f,label:p});try{if(!(await fetch(`/api/sessions/${n}/label`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:p})})).ok)throw new Error("Server error")}catch{a(r===h?h:r);const m=i.get(n);m&&t({...m,label:r===h?h:r}),Nt("Failed to save label","error")}p&&AV(p)},[n,r,i,t]);return A.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:o.map(h=>{const p=h===r,f=EV[h]||"var(--text-secondary)";return A.jsx("button",{onClick:()=>u(h),style:{display:"inline-flex",alignItems:"center",gap:"4px",background:p?`${f}1a`:"transparent",border:`1px solid ${p?f:"var(--border-subtle)"}`,color:p?f:"var(--text-dim)",fontFamily:"var(--font-mono)",fontSize:"10px",fontWeight:600,letterSpacing:"0.5px",padding:"3px 8px",borderRadius:"10px",cursor:"pointer",transition:"all 0.15s"},children:h},h)})})}function MV({session:n}){const e=yn(b=>b.deselectSession),t=yn(b=>b.removeSession);yn(b=>b.updateSession),yn(b=>b.selectSession);const i=bi(b=>b.openModal),r=Gs(b=>b.rooms),a=Gs(b=>b.addSession),l=Gs(b=>b.removeSession),[o,u]=V.useState(!1),h=V.useRef(null),p=n.status==="ended";V.useEffect(()=>()=>{h.current?.abort()},[n.sessionId]);const f=V.useCallback(async()=>{if(o||!p)return;h.current?.abort();const b=new AbortController;h.current=b,u(!0);try{const O=await(await fetch(`/api/sessions/${n.sessionId}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},signal:b.signal})).json();O.ok?Nt("Resuming Claude session in terminal","success"):Nt(O.error||"Resume failed","error")}catch(C){if(C.name==="AbortError")return;Nt(C.message,"error")}finally{u(!1)}},[n.sessionId,o,p]),m=V.useCallback(()=>{i(Gb)},[i]),g=V.useCallback(async()=>{try{const b=await Kt.sessions.get(n.sessionId);b&&await Kt.sessions.update(n.sessionId,{status:"ended",archived:1,endedAt:b.endedAt||Date.now()}),(await fetch(`/api/sessions/${n.sessionId}`,{method:"DELETE"})).ok||Nt("Server archive failed, archived locally","warning"),e(),t(n.sessionId),Nt("Session archived to history","success")}catch(b){Nt(b.message,"error")}},[n.sessionId,e,t]),_=V.useCallback(async()=>{const b=n.title||n.projectName||n.sessionId.slice(0,8);if(window.confirm(`Permanently delete session "${b}"?
112
+ This cannot be undone.`))try{await fetch(`/api/sessions/${n.sessionId}`,{method:"DELETE"}),await bO(n.sessionId),e(),t(n.sessionId),Nt(`Session "${b}" permanently removed`,"success")}catch(C){Nt(C.message,"error")}},[n.sessionId,n.title,n.projectName,e,t]),w=V.useCallback(()=>{i(Yb)},[i]),v=V.useCallback(()=>{i(Kb)},[i]),x=V.useCallback(b=>{const C=b.target.value;if(C==="__new__"){const O=window.prompt("New room name:");if(O?.trim()){const M=Gs.getState().createRoom(O.trim());Gs.getState().addSession(M,n.sessionId),Nt(`Created and assigned to "${O.trim()}"`,"success")}return}for(const O of r)O.sessionIds.includes(n.sessionId)&&l(O.id,n.sessionId);C?(a(C,n.sessionId),Nt("Moved to room","info")):Nt("Removed from room","info")},[n.sessionId,r,a,l]),S=r.find(b=>b.sessionIds.includes(n.sessionId))?.id||"";return A.jsxs("div",{children:[A.jsxs("div",{className:We.ctrlBar,children:[p&&A.jsx("button",{className:`${We.ctrlBtn} ${We.resume}`,onClick:f,disabled:o,children:o?"RESUMING...":"RESUME"}),A.jsx("button",{className:`${We.ctrlBtn} ${We.kill}`,onClick:m,children:"KILL"}),A.jsx("button",{className:`${We.ctrlBtn} ${We.archive}`,onClick:g,children:"ARCHIVE"}),A.jsx("button",{className:`${We.ctrlBtn} ${We.delete}`,onClick:_,children:"DELETE"}),A.jsx("button",{className:`${We.ctrlBtn} ${We.summarize}`,onClick:w,children:"SUMMARIZE"}),A.jsx("button",{className:`${We.ctrlBtn} ${We.alert}`,onClick:v,children:"ALERT"}),A.jsxs("select",{className:We.ctrlSelect,value:S,onChange:x,children:[A.jsx("option",{value:"",children:"No room"}),r.map(b=>A.jsx("option",{value:b.id,children:b.name},b.id)),A.jsx("option",{value:"__new__",children:"+ New Room"})]})]}),A.jsx("div",{style:{padding:"8px 20px",borderBottom:"1px solid var(--border-subtle)"},children:A.jsx(TV,{sessionId:n.sessionId,currentLabel:n.label||""})})]})}var aE=yE(),j_={exports:{}},oE;function RV(){return oE||(oE=1,(function(n,e){(function(t,i){n.exports=i()})(globalThis,(()=>(()=>{var t={4567:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var B=S.length-1;B>=0;B--)(M=S[B])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=u(9042),m=u(9924),g=u(844),_=u(4725),w=u(2585),v=u(3656);let x=o.AccessibilityManager=class extends g.Disposable{constructor(S,b,C,O){super(),this._terminal=S,this._coreBrowserService=C,this._renderService=O,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let M=0;M<this._terminal.rows;M++)this._rowElements[M]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[M]);if(this._topBoundaryFocusListener=M=>this._handleBoundaryFocus(M,0),this._bottomBoundaryFocusListener=M=>this._handleBoundaryFocus(M,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(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((M=>this._handleResize(M.rows)))),this.register(this._terminal.onRender((M=>this._refreshRows(M.start,M.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((M=>this._handleChar(M)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
113
+ `)))),this.register(this._terminal.onA11yTab((M=>this._handleTab(M)))),this.register(this._terminal.onKey((M=>this._handleKey(M.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(S){for(let b=0;b<S;b++)this._handleChar(" ")}_handleChar(S){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==S&&(this._charsToAnnounce+=S):this._charsToAnnounce+=S,S===`
114
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(S){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(S)||this._charsToConsume.push(S)}_refreshRows(S,b){this._liveRegionDebouncer.refresh(S,b,this._terminal.rows)}_renderRows(S,b){const C=this._terminal.buffer,O=C.lines.length.toString();for(let M=S;M<=b;M++){const D=C.lines.get(C.ydisp+M),N=[],B=D?.translateToString(!0,void 0,void 0,N)||"",U=(C.ydisp+M+1).toString(),Y=this._rowElements[M];Y&&(B.length===0?(Y.innerText=" ",this._rowColumns.set(Y,[0,1])):(Y.textContent=B,this._rowColumns.set(Y,N)),Y.setAttribute("aria-posinset",U),Y.setAttribute("aria-setsize",O))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(S,b){const C=S.target,O=this._rowElements[b===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||S.relatedTarget!==O)return;let M,D;if(b===0?(M=C,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(M=this._rowElements.shift(),D=C,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),S.preventDefault(),S.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const S=document.getSelection();if(!S)return;if(S.isCollapsed)return void(this._rowContainer.contains(S.anchorNode)&&this._terminal.clearSelection());if(!S.anchorNode||!S.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:S.anchorNode,offset:S.anchorOffset},C={node:S.focusNode,offset:S.focusOffset};if((b.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===C.node&&b.offset>C.offset)&&([b,C]=[C,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const O=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(O)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:O,offset:O.textContent?.length??0}),!this._rowContainer.contains(C.node))return;const M=({node:B,offset:U})=>{const Y=B instanceof Text?B.parentNode:B;let K=parseInt(Y?.getAttribute("aria-posinset"),10)-1;if(isNaN(K))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(Y);if(!H)return console.warn("columns is null. Race condition?"),null;let J=U<H.length?H[U]:H.slice(-1)[0]+1;return J>=this._terminal.cols&&(++K,J=0),{row:K,column:J}},D=M(b),N=M(C);if(D&&N){if(D.row>N.row||D.row===N.row&&D.column>=N.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(N.row-D.row)*this._terminal.cols-D.column+N.column)}}_handleResize(S){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const S=this._coreBrowserService.mainDocument.createElement("div");return S.setAttribute("role","listitem"),S.tabIndex=-1,this._refreshRowDimensions(S),S}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let S=0;S<this._terminal.rows;S++)this._refreshRowDimensions(this._rowElements[S])}}_refreshRowDimensions(S){S.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=x=h([p(1,w.IInstantiationService),p(2,_.ICoreBrowserService),p(3,_.IRenderService)],x)},3614:(l,o)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function h(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function p(m,g,_,w){m=h(m=u(m),_.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(m,!0),g.value=""}function f(m,g,_){const w=_.getBoundingClientRect(),v=m.clientX-w.left-10,x=m.clientY-w.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${x}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=u,o.bracketTextForPaste=h,o.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},o.handlePasteEvent=function(m,g,_,w){m.stopPropagation(),m.clipboardData&&p(m.clipboardData.getData("text/plain"),g,_,w)},o.paste=p,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(m,g,_,w,v){f(m,g,_),v&&w.rightClickSelect(m),g.value=w.selectionText,g.select()}},7239:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=u(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,f,m){this._css.set(p,f,m)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,m){this._color.set(p,f,m)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(u,h,p,f){u.addEventListener(h,p,f);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(h,p,f))}}}},3551:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=u(3656),m=u(8460),g=u(844),_=u(2585),w=u(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(x,S,b,C,O){super(),this._element=x,this._mouseService=S,this._renderService=b,this._bufferService=C,this._linkProviderService=O,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(x){this._lastMouseEvent=x;const S=this._positionFromMouseEvent(x,this._element,this._mouseService);if(!S)return;this._isMouseOut=!1;const b=x.composedPath();for(let C=0;C<b.length;C++){const O=b[C];if(O.classList.contains("xterm"))break;if(O.classList.contains("xterm-hover"))return}this._lastBufferCell&&S.x===this._lastBufferCell.x&&S.y===this._lastBufferCell.y||(this._handleHover(S),this._lastBufferCell=S)}_handleHover(x){if(this._activeLine!==x.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(x,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,x)||(this._clearCurrentLink(),this._askForLink(x,!0))}_askForLink(x,S){this._activeProviderReplies&&S||(this._activeProviderReplies?.forEach((C=>{C?.forEach((O=>{O.link.dispose&&O.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=x.y);let b=!1;for(const[C,O]of this._linkProviderService.linkProviders.entries())S?this._activeProviderReplies?.get(C)&&(b=this._checkLinkProviderResult(C,x,b)):O.provideLinks(x.y,(M=>{if(this._isMouseOut)return;const D=M?.map((N=>({link:N})));this._activeProviderReplies?.set(C,D),b=this._checkLinkProviderResult(C,x,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(x.y,this._activeProviderReplies)}))}_removeIntersectingLinks(x,S){const b=new Set;for(let C=0;C<S.size;C++){const O=S.get(C);if(O)for(let M=0;M<O.length;M++){const D=O[M],N=D.link.range.start.y<x?0:D.link.range.start.x,B=D.link.range.end.y>x?this._bufferService.cols:D.link.range.end.x;for(let U=N;U<=B;U++){if(b.has(U)){O.splice(M--,1);break}b.add(U)}}}}_checkLinkProviderResult(x,S,b){if(!this._activeProviderReplies)return b;const C=this._activeProviderReplies.get(x);let O=!1;for(let M=0;M<x;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(O=!0);if(!O&&C){const M=C.find((D=>this._linkAtPosition(D.link,S)));M&&(b=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let M=0;M<this._activeProviderReplies.size;M++){const D=this._activeProviderReplies.get(M)?.find((N=>this._linkAtPosition(N.link,S)));if(D){b=!0,this._handleNewLink(D);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(x){if(!this._currentLink)return;const S=this._positionFromMouseEvent(x,this._element,this._mouseService);S&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,S)&&this._currentLink.link.activate(x,this._currentLink.link.text)}_clearCurrentLink(x,S){this._currentLink&&this._lastMouseEvent&&(!x||!S||this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=S)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(x){if(!this._lastMouseEvent)return;const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._linkAtPosition(x.link,S)&&(this._currentLink=x,this._currentLink.state={decorations:{underline:x.link.decorations===void 0||x.link.decorations.underline,pointerCursor:x.link.decorations===void 0||x.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,x.link,this._lastMouseEvent),x.link.decorations={},Object.defineProperties(x.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(x.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const C=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=O&&(this._clearCurrentLink(C,O),this._lastMouseEvent)){const M=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);M&&this._askForLink(M,!1)}}))))}_linkHover(x,S,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!0),this._currentLink.state.decorations.pointerCursor&&x.classList.add("xterm-cursor-pointer")),S.hover&&S.hover(b,S.text)}_fireUnderlineEvent(x,S){const b=x.range,C=this._bufferService.buffer.ydisp,O=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-C-1,b.end.x,b.end.y-C-1,void 0);(S?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(O)}_linkLeave(x,S,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!1),this._currentLink.state.decorations.pointerCursor&&x.classList.remove("xterm-cursor-pointer")),S.leave&&S.leave(b,S.text)}_linkAtPosition(x,S){const b=x.range.start.y*this._bufferService.cols+x.range.start.x,C=x.range.end.y*this._bufferService.cols+x.range.end.x,O=S.y*this._bufferService.cols+S.x;return b<=O&&O<=C}_positionFromMouseEvent(x,S,b){const C=b.getCoords(x,S,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(x,S,b,C,O){return{x1:x,y1:S,x2:b,y2:C,cols:this._bufferService.cols,fg:O}}};o.Linkifier=v=h([p(1,w.IMouseService),p(2,w.IRenderService),p(3,_.IBufferService),p(4,w.ILinkProviderService)],v)},9042:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=u(511),m=u(2585);let g=o.OscLinkProvider=class{constructor(w,v,x){this._bufferService=w,this._optionsService=v,this._oscLinkService=x}provideLinks(w,v){const x=this._bufferService.buffer.lines.get(w-1);if(!x)return void v(void 0);const S=[],b=this._optionsService.rawOptions.linkHandler,C=new f.CellData,O=x.getTrimmedLength();let M=-1,D=-1,N=!1;for(let B=0;B<O;B++)if(D!==-1||x.hasContent(B)){if(x.loadCell(B,C),C.hasExtendedAttrs()&&C.extended.urlId){if(D===-1){D=B,M=C.extended.urlId;continue}N=C.extended.urlId!==M}else D!==-1&&(N=!0);if(N||D!==-1&&B===O-1){const U=this._oscLinkService.getLinkData(M)?.uri;if(U){const Y={start:{x:D+1,y:w},end:{x:B+(N||B!==O-1?0:1),y:w}};let K=!1;if(!b?.allowNonHttpProtocols)try{const H=new URL(U);["http:","https:"].includes(H.protocol)||(K=!0)}catch{K=!0}K||S.push({text:U,range:Y,activate:(H,J)=>b?b.activate(H,J,Y):_(0,J),hover:(H,J)=>b?.hover?.(H,J,Y),leave:(H,J)=>b?.leave?.(H,J,Y)})}N=!1,C.hasExtendedAttrs()&&C.extended.urlId?(D=B,M=C.extended.urlId):(D=-1,M=-1)}}v(S)}};function _(w,v){if(confirm(`Do you want to navigate to ${v}?
115
+
116
+ WARNING: This link could potentially be dangerous`)){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=h([p(0,m.IBufferService),p(1,m.IOptionsService),p(2,m.IOscLinkService)],g)},6193:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,p){this._rowCount=p,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=u(3614),p=u(3656),f=u(3551),m=u(9042),g=u(3730),_=u(1680),w=u(3107),v=u(5744),x=u(2950),S=u(1296),b=u(428),C=u(4269),O=u(5114),M=u(8934),D=u(3230),N=u(9312),B=u(4725),U=u(6731),Y=u(8055),K=u(8969),H=u(8460),J=u(844),Q=u(6114),Z=u(8437),ie=u(2584),ne=u(7399),P=u(5941),L=u(9074),F=u(2585),$=u(5435),W=u(4567),ye=u(779);class be extends K.CoreTerminal{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}constructor(le={}){super(le),this.browser=Q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ye.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((ee,Ce)=>this.refresh(ee,Ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((ee=>this._reportWindowsOptions(ee)))),this.register(this._inputHandler.onColor((ee=>this._handleColorEvent(ee)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((ee=>this._afterResize(ee.cols,ee.rows)))),this.register((0,J.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(le){if(this._themeService)for(const ee of le){let Ce,xe="";switch(ee.index){case 256:Ce="foreground",xe="10";break;case 257:Ce="background",xe="11";break;case 258:Ce="cursor",xe="12";break;default:Ce="ansi",xe="4;"+ee.index}switch(ee.type){case 0:const Ze=Y.color.toColorRGB(Ce==="ansi"?this._themeService.colors.ansi[ee.index]:this._themeService.colors[Ce]);this.coreService.triggerDataEvent(`${ie.C0.ESC}]${xe};${(0,P.toRgbString)(Ze)}${ie.C1_ESCAPED.ST}`);break;case 1:if(Ce==="ansi")this._themeService.modifyColors((De=>De.ansi[ee.index]=Y.channels.toColor(...ee.color)));else{const De=Ce;this._themeService.modifyColors((wt=>wt[De]=Y.channels.toColor(...ee.color)))}break;case 2:this._themeService.restoreColor(ee.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(le){le?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(le){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ie.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ie.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const le=this.buffer.ybase+this.buffer.y,ee=this.buffer.lines.get(le);if(!ee)return;const Ce=Math.min(this.buffer.x,this.cols-1),xe=this._renderService.dimensions.css.cell.height,Ze=ee.getWidth(Ce),De=this._renderService.dimensions.css.cell.width*Ze,wt=this.buffer.y*this._renderService.dimensions.css.cell.height,Fe=Ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Fe+"px",this.textarea.style.top=wt+"px",this.textarea.style.width=De+"px",this.textarea.style.height=xe+"px",this.textarea.style.lineHeight=xe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(ee=>{this.hasSelection()&&(0,h.copyHandler)(ee,this._selectionService)})));const le=ee=>(0,h.handlePasteEvent)(ee,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",le)),this.register((0,p.addDisposableDomListener)(this.element,"paste",le)),Q.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ee=>{ee.button===2&&(0,h.rightClickHandler)(ee,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(ee=>{(0,h.rightClickHandler)(ee,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Q.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(ee=>{ee.button===1&&(0,h.moveTextAreaUnderMouseCursor)(ee,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(le=>this._keyUp(le)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(le=>this._keyDown(le)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(le=>this._keyPress(le)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(le=>this._compositionHelper.compositionupdate(le)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(le=>this._inputEvent(le)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(le){if(!le)throw new Error("Terminal requires a parent element.");if(le.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=le.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"),le.appendChild(this.element);const ee=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ee.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(Ce=>this.updateCursorStyle(Ce)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ee.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),Q.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(O.CoreBrowserService,this.textarea,le.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(Ce=>this._handleTextAreaFocus(Ce)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Ce=>this._onRender.fire(Ce)))),this.onResize((Ce=>this._renderService.resize(Ce.cols,Ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(x.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(M.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(ee);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Ce=>this.scrollLines(Ce.amount,Ce.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Ce=>this.scrollLines(Ce.amount,Ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Ce=>this._renderService.handleSelectionChanged(Ce.start,Ce.end,Ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Ce=>{this.textarea.value=Ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(Ce=>this._selectionService.handleMouseDown(Ce)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Ce=>this._handleScreenReaderModeOptionChange(Ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Ce=>{!this._overviewRulerRenderer&&Ce&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(S.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const le=this,ee=this.element;function Ce(De){const wt=le._mouseService.getMouseReportCoords(De,le.screenElement);if(!wt)return!1;let Fe,qe;switch(De.overrideType||De.type){case"mousemove":qe=32,De.buttons===void 0?(Fe=3,De.button!==void 0&&(Fe=De.button<3?De.button:3)):Fe=1&De.buttons?0:4&De.buttons?1:2&De.buttons?2:3;break;case"mouseup":qe=0,Fe=De.button<3?De.button:3;break;case"mousedown":qe=1,Fe=De.button<3?De.button:3;break;case"wheel":if(le._customWheelEventHandler&&le._customWheelEventHandler(De)===!1||le.viewport.getLinesScrolled(De)===0)return!1;qe=De.deltaY<0?0:1,Fe=4;break;default:return!1}return!(qe===void 0||Fe===void 0||Fe>4)&&le.coreMouseService.triggerMouseEvent({col:wt.col,row:wt.row,x:wt.x,y:wt.y,button:Fe,action:qe,ctrl:De.ctrlKey,alt:De.altKey,shift:De.shiftKey})}const xe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ze={mouseup:De=>(Ce(De),De.buttons||(this._document.removeEventListener("mouseup",xe.mouseup),xe.mousedrag&&this._document.removeEventListener("mousemove",xe.mousedrag)),this.cancel(De)),wheel:De=>(Ce(De),this.cancel(De,!0)),mousedrag:De=>{De.buttons&&Ce(De)},mousemove:De=>{De.buttons||Ce(De)}};this.register(this.coreMouseService.onProtocolChange((De=>{De?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(De)),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()),8&De?xe.mousemove||(ee.addEventListener("mousemove",Ze.mousemove),xe.mousemove=Ze.mousemove):(ee.removeEventListener("mousemove",xe.mousemove),xe.mousemove=null),16&De?xe.wheel||(ee.addEventListener("wheel",Ze.wheel,{passive:!1}),xe.wheel=Ze.wheel):(ee.removeEventListener("wheel",xe.wheel),xe.wheel=null),2&De?xe.mouseup||(xe.mouseup=Ze.mouseup):(this._document.removeEventListener("mouseup",xe.mouseup),xe.mouseup=null),4&De?xe.mousedrag||(xe.mousedrag=Ze.mousedrag):(this._document.removeEventListener("mousemove",xe.mousedrag),xe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(ee,"mousedown",(De=>{if(De.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(De))return Ce(De),xe.mouseup&&this._document.addEventListener("mouseup",xe.mouseup),xe.mousedrag&&this._document.addEventListener("mousemove",xe.mousedrag),this.cancel(De)}))),this.register((0,p.addDisposableDomListener)(ee,"wheel",(De=>{if(!xe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(De)===!1)return!1;if(!this.buffer.hasScrollback){const wt=this.viewport.getLinesScrolled(De);if(wt===0)return;const Fe=ie.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(De.deltaY<0?"A":"B");let qe="";for(let ze=0;ze<Math.abs(wt);ze++)qe+=Fe;return this.coreService.triggerDataEvent(qe,!0),this.cancel(De,!0)}return this.viewport.handleWheel(De)?this.cancel(De):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(ee,"touchstart",(De=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(De),this.cancel(De)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(ee,"touchmove",(De=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(De)?void 0:this.cancel(De)}),{passive:!1}))}refresh(le,ee){this._renderService?.refreshRows(le,ee)}updateCursorStyle(le){this._selectionService?.shouldColumnSelect(le)?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(le,ee,Ce=0){Ce===1?(super.scrollLines(le,ee,Ce),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(le)}paste(le){(0,h.paste)(le,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(le){this._customKeyEventHandler=le}attachCustomWheelEventHandler(le){this._customWheelEventHandler=le}registerLinkProvider(le){return this._linkProviderService.registerLinkProvider(le)}registerCharacterJoiner(le){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const ee=this._characterJoinerService.register(le);return this.refresh(0,this.rows-1),ee}deregisterCharacterJoiner(le){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(le)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(le){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+le)}registerDecoration(le){return this._decorationService.registerDecoration(le)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(le,ee,Ce){this._selectionService.setSelection(le,ee,Ce)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(le,ee){this._selectionService?.selectLines(le,ee)}_keyDown(le){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(le)===!1)return!1;const ee=this.browser.isMac&&this.options.macOptionIsMeta&&le.altKey;if(!ee&&!this._compositionHelper.keydown(le))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;ee||le.key!=="Dead"&&le.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Ce=(0,ne.evaluateKeyboardEvent)(le,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(le),Ce.type===3||Ce.type===2){const xe=this.rows-1;return this.scrollLines(Ce.type===2?-xe:xe),this.cancel(le,!0)}return Ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,le)||(Ce.cancel&&this.cancel(le,!0),!Ce.key||!!(le.key&&!le.ctrlKey&&!le.altKey&&!le.metaKey&&le.key.length===1&&le.key.charCodeAt(0)>=65&&le.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Ce.key!==ie.C0.ETX&&Ce.key!==ie.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Ce.key,domEvent:le}),this._showCursor(),this.coreService.triggerDataEvent(Ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||le.altKey||le.ctrlKey?this.cancel(le,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(le,ee){const Ce=le.isMac&&!this.options.macOptionIsMeta&&ee.altKey&&!ee.ctrlKey&&!ee.metaKey||le.isWindows&&ee.altKey&&ee.ctrlKey&&!ee.metaKey||le.isWindows&&ee.getModifierState("AltGraph");return ee.type==="keypress"?Ce:Ce&&(!ee.keyCode||ee.keyCode>47)}_keyUp(le){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(le)===!1||((function(ee){return ee.keyCode===16||ee.keyCode===17||ee.keyCode===18})(le)||this.focus(),this.updateCursorStyle(le),this._keyPressHandled=!1)}_keyPress(le){let ee;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(le)===!1)return!1;if(this.cancel(le),le.charCode)ee=le.charCode;else if(le.which===null||le.which===void 0)ee=le.keyCode;else{if(le.which===0||le.charCode===0)return!1;ee=le.which}return!(!ee||(le.altKey||le.ctrlKey||le.metaKey)&&!this._isThirdLevelShift(this.browser,le)||(ee=String.fromCharCode(ee),this._onKey.fire({key:ee,domEvent:le}),this._showCursor(),this.coreService.triggerDataEvent(ee,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(le){if(le.data&&le.inputType==="insertText"&&(!le.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const ee=le.data;return this.coreService.triggerDataEvent(ee,!0),this.cancel(le),!0}return!1}resize(le,ee){le!==this.cols||ee!==this.rows?super.resize(le,ee):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(le,ee){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}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 le=1;le<this.rows;le++)this.buffer.lines.push(this.buffer.getBlankLine(Z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const le=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=le,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ie.C0.ESC+"[I"):this.coreService.triggerDataEvent(ie.C0.ESC+"[O")}_reportWindowsOptions(le){if(this._renderService)switch(le){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const ee=this._renderService.dimensions.css.canvas.width.toFixed(0),Ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ie.C0.ESC}[4;${Ce};${ee}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const xe=this._renderService.dimensions.css.cell.width.toFixed(0),Ze=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ie.C0.ESC}[6;${Ze};${xe}t`)}}cancel(le,ee){if(this.options.cancelEvents||ee)return le.preventDefault(),le.stopPropagation(),!1}}o.Terminal=be},9924:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,p){this._rowCount=p,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=f-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=u(3656),m=u(4725),g=u(8460),_=u(844),w=u(2585);let v=o.Viewport=class extends _.Disposable{constructor(x,S,b,C,O,M,D,N){super(),this._viewportElement=x,this._scrollArea=S,this._bufferService=b,this._optionsService=C,this._charSizeService=O,this._renderService=M,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(x){this._viewportElement.style.backgroundColor=x.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(x){if(x)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const S=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==S&&(this._lastRecordedBufferHeight=S,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const x=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==x&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=x),this._refreshAnimationFrame=null}syncScrollArea(x=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(x);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(x)}_handleScroll(x){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const S=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const x=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(x*(this._smoothScrollState.target-this._smoothScrollState.origin)),x<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(x,S){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(S<0&&this._viewportElement.scrollTop!==0||S>0&&b<this._lastRecordedBufferHeight)||(x.cancelable&&x.preventDefault(),!1)}handleWheel(x){const S=this._getPixelsScrolled(x);return S!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+S:this._smoothScrollState.target+=S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=S,this._bubbleScroll(x,S))}scrollLines(x){if(x!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const S=x*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!1})}_getPixelsScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let S=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_LINE?S*=this._currentRowHeight:x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._currentRowHeight*this._bufferService.rows),S}getBufferElements(x,S){let b,C="";const O=[],M=S??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let N=x;N<M;N++){const B=D.get(N);if(!B)continue;const U=D.get(N+1)?.isWrapped;if(C+=B.translateToString(!U),!U||N===D.length-1){const Y=document.createElement("div");Y.textContent=C,O.push(Y),C.length>0&&(b=Y),C=""}}return{bufferElements:O,cursorElement:b}}getLinesScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let S=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=this._currentRowHeight+0,this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(x,S){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&S.altKey||b==="ctrl"&&S.ctrlKey||b==="shift"&&S.shiftKey?x*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:x*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(x){this._lastTouchY=x.touches[0].pageY}handleTouchMove(x){const S=this._lastTouchY-x.touches[0].pageY;return this._lastTouchY=x.touches[0].pageY,S!==0&&(this._viewportElement.scrollTop+=S,this._bubbleScroll(x,S))}};o.Viewport=v=h([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,m.ICharSizeService),p(5,m.IRenderService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],v)},3107:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=u(4725),m=u(844),g=u(2585);let _=o.BufferDecorationRenderer=class extends m.Disposable{constructor(w,v,x,S,b){super(),this._screenElement=w,this._bufferService=v,this._coreBrowserService=x,this._decorationService=S,this._renderService=b,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((C=>this._removeDecoration(C)))),this.register((0,m.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),v.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const x=w.options.x??0;return x&&x>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(w,v),v}_refreshStyle(w){const v=w.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let x=this._decorationElements.get(w);x||(x=this._createElement(w),w.element=x,this._decorationElements.set(w,x),this._container.appendChild(x),w.onDispose((()=>{this._decorationElements.delete(w),x.remove()}))),x.style.top=v*this._renderService.dimensions.css.cell.height+"px",x.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(x)}}_refreshXPosition(w,v=w.element){if(!v)return;const x=w.options.x??0;(w.options.anchor||"left")==="right"?v.style.right=x?x*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=x?x*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=_=h([p(1,g.IBufferService),p(2,f.ICoreBrowserService),p(3,g.IDecorationService),p(4,f.IRenderService)],_)},5871:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=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(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,p){return h>=u.startBufferLine-this._linePadding[p||"full"]&&h<=u.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(l,o,u){var h=this&&this.__decorate||function(b,C,O,M){var D,N=arguments.length,B=N<3?C:M===null?M=Object.getOwnPropertyDescriptor(C,O):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,C,O,M);else for(var U=b.length-1;U>=0;U--)(D=b[U])&&(B=(N<3?D(B):N>3?D(C,O,B):D(C,O))||B);return N>3&&B&&Object.defineProperty(C,O,B),B},p=this&&this.__param||function(b,C){return function(O,M){C(O,M,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=u(5871),m=u(4725),g=u(844),_=u(2585),w={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0};let S=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,C,O,M,D,N,B){super(),this._viewportElement=b,this._screenElement=C,this._bufferService=O,this._decorationService=M,this._renderService=D,this._optionsService=N,this._coreBrowserService=B,this._colorZoneStore=new f.ColorZoneStore,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=b,v.center=C,v.right=b,this._refreshDrawHeightConstants(),x.full=0,x.left=0,x.center=v.left,x.right=v.left+v.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=C,w.center=C,w.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const C of b)C.position!=="full"&&this._renderColorZone(C);for(const C of b)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(x[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),v[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,C){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=S=h([p(2,_.IBufferService),p(3,_.IDecorationService),p(4,m.IRenderService),p(5,_.IOptionsService),p(6,m.ICoreBrowserService)],S)},2950:function(l,o,u){var h=this&&this.__decorate||function(w,v,x,S){var b,C=arguments.length,O=C<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(w,v,x,S);else for(var M=w.length-1;M>=0;M--)(b=w[M])&&(O=(C<3?b(O):C>3?b(v,x,O):b(v,x))||O);return C>3&&O&&Object.defineProperty(v,x,O),O},p=this&&this.__param||function(w,v){return function(x,S){v(x,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=u(4725),m=u(2585),g=u(2584);let _=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,v,x,S,b,C){this._textarea=w,this._compositionView=v,this._bufferService=x,this._optionsService=S,this._coreService=b,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let x;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,x=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),x.length>0&&this._coreService.triggerDataEvent(x,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,x=v.replace(w,"");this._dataAlreadySent=x,v.length>w.length?this._coreService.triggerDataEvent(x,!0):v.length<w.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):v.length===w.length&&v!==w&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),x=this._renderService.dimensions.css.cell.height,S=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=S+"px",this._compositionView.style.height=x+"px",this._compositionView.style.lineHeight=x+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const C=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=S+"px",this._textarea.style.width=Math.max(C.width,1)+"px",this._textarea.style.height=Math.max(C.height,1)+"px",this._textarea.style.lineHeight=C.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=_=h([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,m.ICoreService),p(5,f.IRenderService)],_)},9806:(l,o)=>{function u(h,p,f){const m=f.getBoundingClientRect(),g=h.getComputedStyle(f),_=parseInt(g.getPropertyValue("padding-left")),w=parseInt(g.getPropertyValue("padding-top"));return[p.clientX-m.left-_,p.clientY-m.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=u,o.getCoords=function(h,p,f,m,g,_,w,v,x){if(!_)return;const S=u(h,p,f);return S?(S[0]=Math.ceil((S[0]+(x?w/2:0))/w),S[1]=Math.ceil(S[1]/v),S[0]=Math.min(Math.max(S[0],1),m+(x?1:0)),S[1]=Math.min(Math.max(S[1],1),g),S):void 0}},9504:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=u(2584);function p(v,x,S,b){const C=v-f(v,S),O=x-f(x,S),M=Math.abs(C-O)-(function(D,N,B){let U=0;const Y=D-f(D,B),K=N-f(N,B);for(let H=0;H<Math.abs(Y-K);H++){const J=m(D,N)==="A"?-1:1;B.buffer.lines.get(Y+J*H)?.isWrapped&&U++}return U})(v,x,S);return w(M,_(m(v,x),b))}function f(v,x){let S=0,b=x.buffer.lines.get(v),C=b?.isWrapped;for(;C&&v>=0&&v<x.rows;)S++,b=x.buffer.lines.get(--v),C=b?.isWrapped;return S}function m(v,x){return v>x?"A":"B"}function g(v,x,S,b,C,O){let M=v,D=x,N="";for(;M!==S||D!==b;)M+=C?1:-1,C&&M>O.cols-1?(N+=O.buffer.translateBufferLineToString(D,!1,v,M),M=0,v=0,D++):!C&&M<0&&(N+=O.buffer.translateBufferLineToString(D,!1,0,v+1),M=O.cols-1,v=M,D--);return N+O.buffer.translateBufferLineToString(D,!1,v,M)}function _(v,x){const S=x?"O":"[";return h.C0.ESC+S+v}function w(v,x){v=Math.floor(v);let S="";for(let b=0;b<v;b++)S+=x;return S}o.moveToCellSequence=function(v,x,S,b){const C=S.buffer.x,O=S.buffer.y;if(!S.buffer.hasScrollback)return(function(N,B,U,Y,K,H){return p(B,Y,K,H).length===0?"":w(g(N,B,N,B-f(B,K),!1,K).length,_("D",H))})(C,O,0,x,S,b)+p(O,x,S,b)+(function(N,B,U,Y,K,H){let J;J=p(B,Y,K,H).length>0?Y-f(Y,K):B;const Q=Y,Z=(function(ie,ne,P,L,F,$){let W;return W=p(P,L,F,$).length>0?L-f(L,F):ne,ie<P&&W<=L||ie>=P&&W<L?"C":"D"})(N,B,U,Y,K,H);return w(g(N,J,U,Q,Z==="C",K).length,_(Z,H))})(C,O,v,x,S,b);let M;if(O===x)return M=C>v?"D":"C",w(Math.abs(C-v),_(M,b));M=O>x?"D":"C";const D=Math.abs(O-x);return w((function(N,B){return B.cols-N})(O>x?v:C,S)+(D-1)*S.cols+1+((O>x?C:v)-1),_(M,b))}},1296:function(l,o,u){var h=this&&this.__decorate||function(H,J,Q,Z){var ie,ne=arguments.length,P=ne<3?J:Z===null?Z=Object.getOwnPropertyDescriptor(J,Q):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(H,J,Q,Z);else for(var L=H.length-1;L>=0;L--)(ie=H[L])&&(P=(ne<3?ie(P):ne>3?ie(J,Q,P):ie(J,Q))||P);return ne>3&&P&&Object.defineProperty(J,Q,P),P},p=this&&this.__param||function(H,J){return function(Q,Z){J(Q,Z,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=u(3787),m=u(2550),g=u(2223),_=u(6171),w=u(6052),v=u(4725),x=u(8055),S=u(8460),b=u(844),C=u(2585),O="xterm-dom-renderer-owner-",M="xterm-rows",D="xterm-fg-",N="xterm-bg-",B="xterm-focus",U="xterm-selection";let Y=1,K=o.DomRenderer=class extends b.Disposable{constructor(H,J,Q,Z,ie,ne,P,L,F,$,W,ye,be){super(),this._terminal=H,this._document=J,this._element=Q,this._screenElement=Z,this._viewportElement=ie,this._helperContainer=ne,this._linkifier2=P,this._charSizeService=F,this._optionsService=$,this._bufferService=W,this._coreBrowserService=ye,this._themeService=be,this._terminalClass=Y++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new S.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(M),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(U),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Ne=>this._injectCss(Ne)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(O+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Ne=>this._handleLinkHover(Ne)))),this.register(this._linkifier2.onHideLinkUnderline((Ne=>this._handleLinkLeave(Ne)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(O+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.WidthCache(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(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),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/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),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(const Q of this._rowElements)Q.style.width=`${this.dimensions.css.canvas.width}px`,Q.style.height=`${this.dimensions.css.cell.height}px`,Q.style.lineHeight=`${this.dimensions.css.cell.height}px`,Q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${M} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${M} .xterm-dim { color: ${x.color.multiplyOpacity(H.foreground,.5).css};}`,J+=`${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;}`;const Q=`blink_underline_${this._terminalClass}`,Z=`blink_bar_${this._terminalClass}`,ie=`blink_block_${this._terminalClass}`;J+=`@keyframes ${Q} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${Z} { 50% { box-shadow: none; }}`,J+=`@keyframes ${ie} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,J+=`${this._terminalSelector} .${M}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${M}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${M}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ie} 1s step-end infinite;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[ne,P]of H.ansi.entries())J+=`${this._terminalSelector} .${D}${ne} { color: ${P.css}; }${this._terminalSelector} .${D}${ne}.xterm-dim { color: ${x.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${N}${ne} { background-color: ${P.css}; }`;J+=`${this._terminalSelector} .${D}${g.INVERTED_DEFAULT_COLOR} { color: ${x.color.opaque(H.background).css}; }${this._terminalSelector} .${D}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${x.color.multiplyOpacity(x.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${N}${g.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,J){for(let Q=this._rowElements.length;Q<=J;Q++){const Z=this._document.createElement("div");this._rowContainer.appendChild(Z),this._rowElements.push(Z)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,J){this._refreshRowElements(H,J),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,J,Q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,J,Q),this.renderRows(0,this._bufferService.rows-1),!H||!J)return;this._selectionRenderModel.update(this._terminal,H,J,Q);const Z=this._selectionRenderModel.viewportStartRow,ie=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||P<0)return;const L=this._document.createDocumentFragment();if(Q){const F=H[0]>J[0];L.appendChild(this._createSelectionElement(ne,F?J[0]:H[0],F?H[0]:J[0],P-ne+1))}else{const F=Z===ne?H[0]:0,$=ne===ie?J[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(ne,F,$));const W=P-ne-1;if(L.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,W)),ne!==P){const ye=ie===P?J[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(P,0,ye))}}this._selectionContainer.appendChild(L)}_createSelectionElement(H,J,Q,Z=1){const ie=this._document.createElement("div"),ne=J*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*(Q-J);return ne+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-ne),ie.style.height=Z*this.dimensions.css.cell.height+"px",ie.style.top=H*this.dimensions.css.cell.height+"px",ie.style.left=`${ne}px`,ie.style.width=`${P}px`,ie}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(const H of this._rowElements)H.replaceChildren()}renderRows(H,J){const Q=this._bufferService.buffer,Z=Q.ybase+Q.y,ie=Math.min(Q.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=H;F<=J;F++){const $=F+Q.ydisp,W=this._rowElements[F],ye=Q.lines.get($);if(!W||!ye)break;W.replaceChildren(...this._rowFactory.createRow(ye,$,$===Z,P,L,ie,ne,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${O}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,J,Q,Z,ie,ne){Q<0&&(H=0),Z<0&&(J=0);const P=this._bufferService.rows-1;Q=Math.max(Math.min(Q,P),0),Z=Math.max(Math.min(Z,P),0),ie=Math.min(ie,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,$=Math.min(L.x,ie-1),W=this._optionsService.rawOptions.cursorBlink,ye=this._optionsService.rawOptions.cursorStyle,be=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ne=Q;Ne<=Z;++Ne){const le=Ne+L.ydisp,ee=this._rowElements[Ne],Ce=L.lines.get(le);if(!ee||!Ce)break;ee.replaceChildren(...this._rowFactory.createRow(Ce,le,le===F,ye,be,$,W,this.dimensions.css.cell.width,this._widthCache,ne?Ne===Q?H:0:-1,ne?(Ne===Z?J:ie)-1:-1))}}};o.DomRenderer=K=h([p(7,C.IInstantiationService),p(8,v.ICharSizeService),p(9,C.IOptionsService),p(10,C.IBufferService),p(11,v.ICoreBrowserService),p(12,v.IThemeService)],K)},3787:function(l,o,u){var h=this&&this.__decorate||function(M,D,N,B){var U,Y=arguments.length,K=Y<3?D:B===null?B=Object.getOwnPropertyDescriptor(D,N):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(M,D,N,B);else for(var H=M.length-1;H>=0;H--)(U=M[H])&&(K=(Y<3?U(K):Y>3?U(D,N,K):U(D,N))||K);return Y>3&&K&&Object.defineProperty(D,N,K),K},p=this&&this.__param||function(M,D){return function(N,B){D(N,B,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=u(2223),m=u(643),g=u(511),_=u(2585),w=u(8055),v=u(4725),x=u(4269),S=u(6171),b=u(3734);let C=o.DomRendererRowFactory=class{constructor(M,D,N,B,U,Y,K){this._document=M,this._characterJoinerService=D,this._optionsService=N,this._coreBrowserService=B,this._coreService=U,this._decorationService=Y,this._themeService=K,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(M,D,N){this._selectionStart=M,this._selectionEnd=D,this._columnSelectMode=N}createRow(M,D,N,B,U,Y,K,H,J,Q,Z){const ie=[],ne=this._characterJoinerService.getJoinedCharacters(D),P=this._themeService.colors;let L,F=M.getNoBgTrimmedLength();N&&F<Y+1&&(F=Y+1);let $=0,W="",ye=0,be=0,Ne=0,le=!1,ee=0,Ce=!1,xe=0;const Ze=[],De=Q!==-1&&Z!==-1;for(let wt=0;wt<F;wt++){M.loadCell(wt,this._workCell);let Fe=this._workCell.getWidth();if(Fe===0)continue;let qe=!1,ze=wt,Ue=this._workCell;if(ne.length>0&&wt===ne[0][0]){qe=!0;const Ht=ne.shift();Ue=new x.JoinedCellData(this._workCell,M.translateToString(!0,Ht[0],Ht[1]),Ht[1]-Ht[0]),ze=Ht[1]-1,Fe=Ue.getWidth()}const at=this._isCellInSelection(wt,D),Lt=N&&wt===Y,St=De&&wt>=Q&&wt<=Z;let Tt=!1;this._decorationService.forEachDecorationAtCell(wt,D,void 0,(Ht=>{Tt=!0}));let Re=Ue.getChars()||m.WHITESPACE_CELL_CHAR;if(Re===" "&&(Ue.isUnderline()||Ue.isOverline())&&(Re=" "),xe=Fe*H-J.get(Re,Ue.isBold(),Ue.isItalic()),L){if($&&(at&&Ce||!at&&!Ce&&Ue.bg===ye)&&(at&&Ce&&P.selectionForeground||Ue.fg===be)&&Ue.extended.ext===Ne&&St===le&&xe===ee&&!Lt&&!qe&&!Tt){Ue.isInvisible()?W+=m.WHITESPACE_CELL_CHAR:W+=Re,$++;continue}$&&(L.textContent=W),L=this._document.createElement("span"),$=0,W=""}else L=this._document.createElement("span");if(ye=Ue.bg,be=Ue.fg,Ne=Ue.extended.ext,le=St,ee=xe,Ce=at,qe&&Y>=wt&&Y<=ze&&(Y=wt),!this._coreService.isCursorHidden&&Lt&&this._coreService.isCursorInitialized){if(Ze.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&Ze.push("xterm-cursor-blink"),Ze.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":Ze.push("xterm-cursor-outline");break;case"block":Ze.push("xterm-cursor-block");break;case"bar":Ze.push("xterm-cursor-bar");break;case"underline":Ze.push("xterm-cursor-underline")}}if(Ue.isBold()&&Ze.push("xterm-bold"),Ue.isItalic()&&Ze.push("xterm-italic"),Ue.isDim()&&Ze.push("xterm-dim"),W=Ue.isInvisible()?m.WHITESPACE_CELL_CHAR:Ue.getChars()||m.WHITESPACE_CELL_CHAR,Ue.isUnderline()&&(Ze.push(`xterm-underline-${Ue.extended.underlineStyle}`),W===" "&&(W=" "),!Ue.isUnderlineColorDefault()))if(Ue.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ue.getUnderlineColor()).join(",")})`;else{let Ht=Ue.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ue.isBold()&&Ht<8&&(Ht+=8),L.style.textDecorationColor=P.ansi[Ht].css}Ue.isOverline()&&(Ze.push("xterm-overline"),W===" "&&(W=" ")),Ue.isStrikethrough()&&Ze.push("xterm-strikethrough"),St&&(L.style.textDecoration="underline");let He=Ue.getFgColor(),st=Ue.getFgColorMode(),kt=Ue.getBgColor(),_e=Ue.getBgColorMode();const Ve=!!Ue.isInverse();if(Ve){const Ht=He;He=kt,kt=Ht;const Pn=st;st=_e,_e=Pn}let ft,Et,Pt,Tn=!1;switch(this._decorationService.forEachDecorationAtCell(wt,D,void 0,(Ht=>{Ht.options.layer!=="top"&&Tn||(Ht.backgroundColorRGB&&(_e=50331648,kt=Ht.backgroundColorRGB.rgba>>8&16777215,ft=Ht.backgroundColorRGB),Ht.foregroundColorRGB&&(st=50331648,He=Ht.foregroundColorRGB.rgba>>8&16777215,Et=Ht.foregroundColorRGB),Tn=Ht.options.layer==="top")})),!Tn&&at&&(ft=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,kt=ft.rgba>>8&16777215,_e=50331648,Tn=!0,P.selectionForeground&&(st=50331648,He=P.selectionForeground.rgba>>8&16777215,Et=P.selectionForeground)),Tn&&Ze.push("xterm-decoration-top"),_e){case 16777216:case 33554432:Pt=P.ansi[kt],Ze.push(`xterm-bg-${kt}`);break;case 50331648:Pt=w.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(L,`background-color:#${O((kt>>>0).toString(16),"0",6)}`);break;default:Ve?(Pt=P.foreground,Ze.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Pt=P.background}switch(ft||Ue.isDim()&&(ft=w.color.multiplyOpacity(Pt,.5)),st){case 16777216:case 33554432:Ue.isBold()&&He<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(He+=8),this._applyMinimumContrast(L,Pt,P.ansi[He],Ue,ft,void 0)||Ze.push(`xterm-fg-${He}`);break;case 50331648:const Ht=w.channels.toColor(He>>16&255,He>>8&255,255&He);this._applyMinimumContrast(L,Pt,Ht,Ue,ft,Et)||this._addStyle(L,`color:#${O(He.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,Pt,P.foreground,Ue,ft,Et)||Ve&&Ze.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Ze.length&&(L.className=Ze.join(" "),Ze.length=0),Lt||qe||Tt?L.textContent=W:$++,xe!==this.defaultSpacing&&(L.style.letterSpacing=`${xe}px`),ie.push(L),wt=ze}return L&&$&&(L.textContent=W),ie}_applyMinimumContrast(M,D,N,B,U,Y){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,S.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const K=this._getContrastCache(B);let H;if(U||Y||(H=K.getColor(D.rgba,N.rgba)),H===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);H=w.color.ensureContrastRatio(U||D,Y||N,J),K.setColor((U||D).rgba,(Y||N).rgba,H??null)}return!!H&&(this._addStyle(M,`color:${H.css}`),!0)}_getContrastCache(M){return M.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(M,D){M.setAttribute("style",`${M.getAttribute("style")||""}${D};`)}_isCellInSelection(M,D){const N=this._selectionStart,B=this._selectionEnd;return!(!N||!B)&&(this._columnSelectMode?N[0]<=B[0]?M>=N[0]&&D>=N[1]&&M<B[0]&&D<=B[1]:M<N[0]&&D>=N[1]&&M>=B[0]&&D<=B[1]:D>N[1]&&D<B[1]||N[1]===B[1]&&D===N[1]&&M>=N[0]&&M<B[0]||N[1]<B[1]&&D===B[1]&&M<B[0]||N[1]<B[1]&&D===N[1]&&M>=N[0])}};function O(M,D,N){for(;M.length<N;)M=D+M;return M}o.DomRendererRowFactory=C=h([p(1,v.ICharacterJoinerService),p(2,_.IOptionsService),p(3,v.ICoreBrowserService),p(4,_.ICoreService),p(5,_.IDecorationService),p(6,v.IThemeService)],C)},2550:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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";const p=u.createElement("span");p.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[p,f,m,g],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(m),this._container.appendChild(g),h.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(u,h,p,f){u===this._font&&h===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,p){let f=0;if(!h&&!p&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const _=this._measure(u,0);return _>0&&(this._flat[f]=_),_}let m=u;h&&(m+="B"),p&&(m+="I");let g=this._holey.get(m);if(g===void 0){let _=0;h&&(_|=1),p&&(_|=2),g=this._measure(u,_),g>0&&this._holey.set(m,g)}return g}_measure(u,h){const p=this._measureElements[h];return p.textContent=u.repeat(32),p.offsetWidth/32}}},2223:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(l,o)=>{function u(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=u,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=h,o.allowRescaling=function(p,f,m,g){return f===1&&m>Math.ceil(1.5*g)&&p!==void 0&&p>255&&!h(p)&&!u(p)&&!(function(_){return 57344<=_&&_<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return u(p)||(function(f){return 9472<=f&&f<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,f,m=0){return(p-(2*Math.round(f)-m))%(2*Math.round(f))}},6052:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class u{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(p,f,m,g=!1){if(this.selectionStart=f,this.selectionEnd=m,!f||!m||f[0]===m[0]&&f[1]===m[1])return void this.clear();const _=p.buffers.active.ydisp,w=f[1]-_,v=m[1]-_,x=Math.max(w,0),S=Math.min(v,p.rows-1);x>=p.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=w,this.viewportEndRow=v,this.viewportCappedStartRow=x,this.viewportCappedEndRow=S,this.startCol=f[0],this.endCol=m[0])}isCellSelected(p,f,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&m>=this.viewportCappedStartRow&&f<this.endCol&&m<=this.viewportCappedEndRow:f<this.startCol&&m>=this.viewportCappedStartRow&&f>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new u}},456:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(u){this._bufferService=u,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.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()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var B=S.length-1;B>=0;B--)(M=S[B])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=u(2585),m=u(8460),g=u(844);let _=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(S,b,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new x(this._optionsService))}catch{this._measureStrategy=this.register(new v(S,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const S=this._measureStrategy.measure();S.width===this.width&&S.height===this.height||(this.width=S.width,this.height=S.height,this._onCharSizeChange.fire())}};o.CharSizeService=_=h([p(2,f.IOptionsService)],_);class w extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,C){b!==void 0&&b>0&&C!==void 0&&C>0&&(this._result.width=b,this._result.height=C)}}class v extends w{constructor(b,C,O){super(),this._document=b,this._parentElement=C,this._optionsService=O,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}}class x extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(l,o,u){var h=this&&this.__decorate||function(x,S,b,C){var O,M=arguments.length,D=M<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,S,b,C);else for(var N=x.length-1;N>=0;N--)(O=x[N])&&(D=(M<3?O(D):M>3?O(S,b,D):O(S,b))||D);return M>3&&D&&Object.defineProperty(S,b,D),D},p=this&&this.__param||function(x,S){return function(b,C){S(b,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=u(3734),m=u(643),g=u(511),_=u(2585);class w extends f.AttributeData{constructor(S,b,C){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=b,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let v=o.CharacterJoinerService=class lA{constructor(S){this._bufferService=S,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(S){const b={id:this._nextCharacterJoinerId++,handler:S};return this._characterJoiners.push(b),b.id}deregister(S){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===S)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(S){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(S);if(!b||b.length===0)return[];const C=[],O=b.translateToString(!0);let M=0,D=0,N=0,B=b.getFg(0),U=b.getBg(0);for(let Y=0;Y<b.getTrimmedLength();Y++)if(b.loadCell(Y,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==U){if(Y-M>1){const K=this._getJoinedRanges(O,N,D,b,M);for(let H=0;H<K.length;H++)C.push(K[H])}M=Y,N=D,B=this._workCell.fg,U=this._workCell.bg}D+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-M>1){const Y=this._getJoinedRanges(O,N,D,b,M);for(let K=0;K<Y.length;K++)C.push(Y[K])}return C}_getJoinedRanges(S,b,C,O,M){const D=S.substring(b,C);let N=[];try{N=this._characterJoiners[0].handler(D)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const U=this._characterJoiners[B].handler(D);for(let Y=0;Y<U.length;Y++)lA._mergeRanges(N,U[Y])}catch(U){console.error(U)}return this._stringRangesToCellRanges(N,O,M),N}_stringRangesToCellRanges(S,b,C){let O=0,M=!1,D=0,N=S[O];if(N){for(let B=C;B<this._bufferService.cols;B++){const U=b.getWidth(B),Y=b.getString(B).length||m.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!M&&N[0]<=D&&(N[0]=B,M=!0),N[1]<=D){if(N[1]=B,N=S[++O],!N)break;N[0]<=D?(N[0]=B,M=!0):M=!1}D+=Y}}N&&(N[1]=this._bufferService.cols)}}static _mergeRanges(S,b){let C=!1;for(let O=0;O<S.length;O++){const M=S[O];if(C){if(b[1]<=M[0])return S[O-1][1]=b[1],S;if(b[1]<=M[1])return S[O-1][1]=Math.max(b[1],M[1]),S.splice(O,1),S;S.splice(O,1),O--}else{if(b[1]<=M[0])return S.splice(O,0,b),S;if(b[1]<=M[1])return M[0]=Math.min(b[0],M[0]),S;b[0]<M[1]&&(M[0]=Math.min(b[0],M[0]),C=!0)}}return C?S[S.length-1][1]=b[1]:S.push(b),S}};o.CharacterJoinerService=v=h([p(0,_.IBufferService)],v)},5114:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=u(844),p=u(8460),f=u(3656);class m extends h.Disposable{constructor(w,v,x){super(),this._textarea=w,this._window=v,this.mainDocument=x,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((S=>this._screenDprMonitor.setWindow(S)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,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}}o.CoreBrowserService=m;class g extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}}},779:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=u(844);class p extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const g=this.linkProviders.indexOf(m);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=p},8934:function(l,o,u){var h=this&&this.__decorate||function(_,w,v,x){var S,b=arguments.length,C=b<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(_,w,v,x);else for(var O=_.length-1;O>=0;O--)(S=_[O])&&(C=(b<3?S(C):b>3?S(w,v,C):S(w,v))||C);return b>3&&C&&Object.defineProperty(w,v,C),C},p=this&&this.__param||function(_,w){return function(v,x){w(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=u(4725),m=u(9806);let g=o.MouseService=class{constructor(_,w){this._renderService=_,this._charSizeService=w}getCoords(_,w,v,x,S){return(0,m.getCoords)(window,_,w,v,x,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,S)}getMouseReportCoords(_,w){const v=(0,m.getCoordsRelativeToElement)(window,_,w);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=g=h([p(0,f.IRenderService),p(1,f.ICharSizeService)],g)},3230:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var B=S.length-1;B>=0;B--)(M=S[B])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=u(6193),m=u(4725),g=u(8460),_=u(844),w=u(7226),v=u(2585);let x=o.RenderService=class extends _.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,b,C,O,M,D,N,B){super(),this._rowCount=S,this._charSizeService=O,this._renderer=this.register(new _.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new _.MutableDisposable),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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((U,Y)=>this._renderRows(U,Y)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(M.onDecorationRegistered((()=>this._fullRefresh()))),this.register(M.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,b),this.register(N.onWindowChange((U=>this._registerIntersectionObserver(U,b))))}_registerIntersectionObserver(S,b){if("IntersectionObserver"in S){const C=new S.IntersectionObserver((O=>this._handleIntersectionChange(O[O.length-1])),{threshold:0});C.observe(b),this._observerDisposable.value=(0,_.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.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(S,b,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,b,this._rowCount))}_renderRows(S,b){this._renderer.value&&(S=Math.min(S,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(S,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:b}),this._onRender.fire({start:S,end:b}),this._isNextRenderRedrawOnly=!0)}resize(S,b){this._rowCount=b,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(S){this._renderer.value=S,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(S,b))):this._renderer.value.handleResize(S,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(S,b,C){this._selectionState.start=S,this._selectionState.end=b,this._selectionState.columnSelectMode=C,this._renderer.value?.handleSelectionChanged(S,b,C)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};o.RenderService=x=h([p(2,v.IOptionsService),p(3,m.ICharSizeService),p(4,v.IDecorationService),p(5,v.IBufferService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],x)},9312:function(l,o,u){var h=this&&this.__decorate||function(N,B,U,Y){var K,H=arguments.length,J=H<3?B:Y===null?Y=Object.getOwnPropertyDescriptor(B,U):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(N,B,U,Y);else for(var Q=N.length-1;Q>=0;Q--)(K=N[Q])&&(J=(H<3?K(J):H>3?K(B,U,J):K(B,U))||J);return H>3&&J&&Object.defineProperty(B,U,J),J},p=this&&this.__param||function(N,B){return function(U,Y){B(U,Y,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=u(9806),m=u(9504),g=u(456),_=u(4725),w=u(8460),v=u(844),x=u(6114),S=u(4841),b=u(511),C=u(2585),O=" ",M=new RegExp(O,"g");let D=o.SelectionService=class extends v.Disposable{constructor(N,B,U,Y,K,H,J,Q,Z){super(),this._element=N,this._screenElement=B,this._linkifier=U,this._bufferService=Y,this._coreService=K,this._mouseService=H,this._optionsService=J,this._renderService=Q,this._coreBrowserService=Z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ie=>this._handleMouseMove(ie),this._mouseUpListener=ie=>this._handleMouseUp(ie),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ie=>this._handleTrim(ie))),this.register(this._bufferService.buffers.onBufferActivate((ie=>this._handleBufferActivate(ie)))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const N=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!N||!B||N[0]===B[0]&&N[1]===B[1])}get selectionText(){const N=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!N||!B)return"";const U=this._bufferService.buffer,Y=[];if(this._activeSelectionMode===3){if(N[0]===B[0])return"";const K=N[0]<B[0]?N[0]:B[0],H=N[0]<B[0]?B[0]:N[0];for(let J=N[1];J<=B[1];J++){const Q=U.translateBufferLineToString(J,!0,K,H);Y.push(Q)}}else{const K=N[1]===B[1]?B[0]:void 0;Y.push(U.translateBufferLineToString(N[1],!0,N[0],K));for(let H=N[1]+1;H<=B[1]-1;H++){const J=U.lines.get(H),Q=U.translateBufferLineToString(H,!0);J?.isWrapped?Y[Y.length-1]+=Q:Y.push(Q)}if(N[1]!==B[1]){const H=U.lines.get(B[1]),J=U.translateBufferLineToString(B[1],!0,0,B[0]);H&&H.isWrapped?Y[Y.length-1]+=J:Y.push(J)}}return Y.map((K=>K.replace(M," "))).join(x.isWindows?`\r
117
+ `:`
118
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),x.isLinux&&N&&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(N){const B=this._getMouseBufferCoords(N),U=this._model.finalSelectionStart,Y=this._model.finalSelectionEnd;return!!(U&&Y&&B)&&this._areCoordsInSelection(B,U,Y)}isCellInSelection(N,B){const U=this._model.finalSelectionStart,Y=this._model.finalSelectionEnd;return!(!U||!Y)&&this._areCoordsInSelection([N,B],U,Y)}_areCoordsInSelection(N,B,U){return N[1]>B[1]&&N[1]<U[1]||B[1]===U[1]&&N[1]===B[1]&&N[0]>=B[0]&&N[0]<U[0]||B[1]<U[1]&&N[1]===U[1]&&N[0]<U[0]||B[1]<U[1]&&N[1]===B[1]&&N[0]>=B[0]}_selectWordAtCursor(N,B){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,S.getRangeLength)(U,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const Y=this._getMouseBufferCoords(N);return!!Y&&(this._selectWordAt(Y,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,B){this._model.clearSelection(),N=Math.max(N,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const B=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(N){let B=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=U?0:(B>U&&(B-=U),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(N){return x.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),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()),50)}_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(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const B=this._getMouseBufferCoords(N);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(N){return N.altKey&&!(x.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);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(N),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const Y=U.lines.get(this._model.selectionEnd[1]);Y&&Y.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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});const N=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const B=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const Y=(0,m.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(Y,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,U=!(!N||!B||N[0]===B[0]&&N[1]===B[1]);U?N&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,B,U)):this._oldHasSelection&&this._fireOnSelectionChange(N,B,U)}_fireOnSelectionChange(N,B,U){this._oldSelectionStart=N,this._oldSelectionEnd=B,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(N,B){let U=B;for(let Y=0;B>=Y;Y++){const K=N.loadCell(Y,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:K>1&&B!==Y&&(U+=K-1)}return U}setSelection(N,B,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,B],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,B,U=!0,Y=!0){if(N[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,H=K.lines.get(N[1]);if(!H)return;const J=K.translateBufferLineToString(N[1],!1);let Q=this._convertViewportColToCharacterIndex(H,N[0]),Z=Q;const ie=N[0]-Q;let ne=0,P=0,L=0,F=0;if(J.charAt(Q)===" "){for(;Q>0&&J.charAt(Q-1)===" ";)Q--;for(;Z<J.length&&J.charAt(Z+1)===" ";)Z++}else{let ye=N[0],be=N[0];H.getWidth(ye)===0&&(ne++,ye--),H.getWidth(be)===2&&(P++,be++);const Ne=H.getString(be).length;for(Ne>1&&(F+=Ne-1,Z+=Ne-1);ye>0&&Q>0&&!this._isCharWordSeparator(H.loadCell(ye-1,this._workCell));){H.loadCell(ye-1,this._workCell);const le=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,ye--):le>1&&(L+=le-1,Q-=le-1),Q--,ye--}for(;be<H.length&&Z+1<J.length&&!this._isCharWordSeparator(H.loadCell(be+1,this._workCell));){H.loadCell(be+1,this._workCell);const le=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,be++):le>1&&(F+=le-1,Z+=le-1),Z++,be++}}Z++;let $=Q+ie-ne+L,W=Math.min(this._bufferService.cols,Z-Q+ne+P-L-F);if(B||J.slice(Q,Z).trim()!==""){if(U&&$===0&&H.getCodePoint(0)!==32){const ye=K.lines.get(N[1]-1);if(ye&&H.isWrapped&&ye.getCodePoint(this._bufferService.cols-1)!==32){const be=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(be){const Ne=this._bufferService.cols-be.start;$-=Ne,W+=Ne}}}if(Y&&$+W===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const ye=K.lines.get(N[1]+1);if(ye?.isWrapped&&ye.getCodePoint(0)!==32){const be=this._getWordAt([0,N[1]+1],!1,!1,!0);be&&(W+=be.length)}}return{start:$,length:W}}}_selectWordAt(N,B){const U=this._getWordAt(N,B);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[U.start,N[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(N){const B=this._getWordAt(N,!0);if(B){let U=N[1];for(;B.start<0;)B.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,U]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const B=this._bufferService.buffer.getWrappedRangeForLine(N),U={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,S.getRangeLength)(U,this._bufferService.cols)}};o.SelectionService=D=h([p(3,C.IBufferService),p(4,C.ICoreService),p(5,_.IMouseService),p(6,C.IOptionsService),p(7,_.IRenderService),p(8,_.ICoreBrowserService)],D)},4725:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=u(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(l,o,u){var h=this&&this.__decorate||function(D,N,B,U){var Y,K=arguments.length,H=K<3?N:U===null?U=Object.getOwnPropertyDescriptor(N,B):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(D,N,B,U);else for(var J=D.length-1;J>=0;J--)(Y=D[J])&&(H=(K<3?Y(H):K>3?Y(N,B,H):Y(N,B))||H);return K>3&&H&&Object.defineProperty(N,B,H),H},p=this&&this.__param||function(D,N){return function(B,U){N(B,U,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),m=u(8055),g=u(8460),_=u(844),w=u(2585),v=m.css.toColor("#ffffff"),x=m.css.toColor("#000000"),S=m.css.toColor("#ffffff"),b=m.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let B=0;B<216;B++){const U=N[B/36%6|0],Y=N[B/6%6|0],K=N[B%6];D.push({css:m.channels.toCss(U,Y,K),rgba:m.channels.toRgba(U,Y,K)})}for(let B=0;B<24;B++){const U=8+10*B;D.push({css:m.channels.toCss(U,U,U),rgba:m.channels.toRgba(U,U,U)})}return D})());let O=o.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:x,cursor:S,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:m.color.blend(x,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:m.color.blend(x,C),ansi:o.DEFAULT_ANSI_COLORS.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))))}_setTheme(D={}){const N=this._colors;if(N.foreground=M(D.foreground,v),N.background=M(D.background,x),N.cursor=M(D.cursor,S),N.cursorAccent=M(D.cursorAccent,b),N.selectionBackgroundTransparent=M(D.selectionBackground,C),N.selectionBackgroundOpaque=m.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=M(D.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=m.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=D.selectionForeground?M(D.selectionForeground,m.NULL_COLOR):void 0,N.selectionForeground===m.NULL_COLOR&&(N.selectionForeground=void 0),m.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=m.color.opacity(N.selectionBackgroundTransparent,.3)),m.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=m.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=o.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=M(D.black,o.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=M(D.red,o.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=M(D.green,o.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=M(D.yellow,o.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=M(D.blue,o.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=M(D.magenta,o.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=M(D.cyan,o.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=M(D.white,o.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=M(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=M(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=M(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=M(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=M(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=M(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=M(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=M(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const B=Math.min(N.ansi.length-16,D.extendedAnsi.length);for(let U=0;U<B;U++)N.ansi[U+16]=M(D.extendedAnsi[U],o.DEFAULT_ANSI_COLORS[U+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let N=0;N<this._restoreColors.ansi.length;++N)this._colors.ansi[N]=this._restoreColors.ansi[N]}modifyColors(D){D(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()}}};function M(D,N){if(D!==void 0)try{return m.css.toColor(D)}catch{}return N}o.ThemeService=O=h([p(0,w.IOptionsService)],O)},6349:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=u(8460),p=u(844);class f extends p.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const _=new Array(g);for(let w=0;w<Math.min(g,this.length);w++)_[w]=this._array[this._getCyclicIndex(w)];this._array=_,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let _=this._length;_<g;_++)this._array[_]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,_){this._array[this._getCyclicIndex(g)]=_}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,_,...w){if(_){for(let v=g;v<this._length-_;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+_)];this._length-=_,this.onDeleteEmitter.fire({index:g,amount:_})}for(let v=this._length-1;v>=g;v--)this._array[this._getCyclicIndex(v+w.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<w.length;v++)this._array[this._getCyclicIndex(g+v)]=w[v];if(w.length&&this.onInsertEmitter.fire({index:g,amount:w.length}),this._length+w.length>this._maxLength){const v=this._length+w.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=w.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,_,w){if(!(_<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let x=_-1;x>=0;x--)this.set(g+x+w,this.get(g+x));const v=g+_+w-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<_;v++)this.set(g+v+w,this.get(g+v))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=f},1439:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function u(h,p=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const m in h)f[m]=p<=1?h[m]:h[m]&&u(h[m],p-1);return f}},8055:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let u=0,h=0,p=0,f=0;var m,g,_,w,v;function x(b){const C=b.toString(16);return C.length<2?"0"+C:C}function S(b,C){return b<C?(C+.05)/(b+.05):(b+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(C,O,M,D){return D!==void 0?`#${x(C)}${x(O)}${x(M)}${x(D)}`:`#${x(C)}${x(O)}${x(M)}`},b.toRgba=function(C,O,M,D=255){return(C<<24|O<<16|M<<8|D)>>>0},b.toColor=function(C,O,M,D){return{css:b.toCss(C,O,M,D),rgba:b.toRgba(C,O,M,D)}}})(m||(o.channels=m={})),(function(b){function C(O,M){return f=Math.round(255*M),[u,h,p]=v.toChannels(O.rgba),{css:m.toCss(u,h,p,f),rgba:m.toRgba(u,h,p,f)}}b.blend=function(O,M){if(f=(255&M.rgba)/255,f===1)return{css:M.css,rgba:M.rgba};const D=M.rgba>>24&255,N=M.rgba>>16&255,B=M.rgba>>8&255,U=O.rgba>>24&255,Y=O.rgba>>16&255,K=O.rgba>>8&255;return u=U+Math.round((D-U)*f),h=Y+Math.round((N-Y)*f),p=K+Math.round((B-K)*f),{css:m.toCss(u,h,p),rgba:m.toRgba(u,h,p)}},b.isOpaque=function(O){return(255&O.rgba)==255},b.ensureContrastRatio=function(O,M,D){const N=v.ensureContrastRatio(O.rgba,M.rgba,D);if(N)return m.toColor(N>>24&255,N>>16&255,N>>8&255)},b.opaque=function(O){const M=(255|O.rgba)>>>0;return[u,h,p]=v.toChannels(M),{css:m.toCss(u,h,p),rgba:M}},b.opacity=C,b.multiplyOpacity=function(O,M){return f=255&O.rgba,C(O,f*M/255)},b.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(g||(o.color=g={})),(function(b){let C,O;try{const M=document.createElement("canvas");M.width=1,M.height=1;const D=M.getContext("2d",{willReadFrequently:!0});D&&(C=D,C.globalCompositeOperation="copy",O=C.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(M){if(M.match(/#[\da-f]{3,8}/i))switch(M.length){case 4:return u=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),p=parseInt(M.slice(3,4).repeat(2),16),m.toColor(u,h,p);case 5:return u=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),p=parseInt(M.slice(3,4).repeat(2),16),f=parseInt(M.slice(4,5).repeat(2),16),m.toColor(u,h,p,f);case 7:return{css:M,rgba:(parseInt(M.slice(1),16)<<8|255)>>>0};case 9:return{css:M,rgba:parseInt(M.slice(1),16)>>>0}}const D=M.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),h=parseInt(D[2]),p=parseInt(D[3]),f=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(u,h,p,f);if(!C||!O)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=O,C.fillStyle=M,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[u,h,p,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(u,h,p,f),css:M}}})(_||(o.css=_={})),(function(b){function C(O,M,D){const N=O/255,B=M/255,U=D/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}b.relativeLuminance=function(O){return C(O>>16&255,O>>8&255,255&O)},b.relativeLuminance2=C})(w||(o.rgb=w={})),(function(b){function C(M,D,N){const B=M>>24&255,U=M>>16&255,Y=M>>8&255;let K=D>>24&255,H=D>>16&255,J=D>>8&255,Q=S(w.relativeLuminance2(K,H,J),w.relativeLuminance2(B,U,Y));for(;Q<N&&(K>0||H>0||J>0);)K-=Math.max(0,Math.ceil(.1*K)),H-=Math.max(0,Math.ceil(.1*H)),J-=Math.max(0,Math.ceil(.1*J)),Q=S(w.relativeLuminance2(K,H,J),w.relativeLuminance2(B,U,Y));return(K<<24|H<<16|J<<8|255)>>>0}function O(M,D,N){const B=M>>24&255,U=M>>16&255,Y=M>>8&255;let K=D>>24&255,H=D>>16&255,J=D>>8&255,Q=S(w.relativeLuminance2(K,H,J),w.relativeLuminance2(B,U,Y));for(;Q<N&&(K<255||H<255||J<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),H=Math.min(255,H+Math.ceil(.1*(255-H))),J=Math.min(255,J+Math.ceil(.1*(255-J))),Q=S(w.relativeLuminance2(K,H,J),w.relativeLuminance2(B,U,Y));return(K<<24|H<<16|J<<8|255)>>>0}b.blend=function(M,D){if(f=(255&D)/255,f===1)return D;const N=D>>24&255,B=D>>16&255,U=D>>8&255,Y=M>>24&255,K=M>>16&255,H=M>>8&255;return u=Y+Math.round((N-Y)*f),h=K+Math.round((B-K)*f),p=H+Math.round((U-H)*f),m.toRgba(u,h,p)},b.ensureContrastRatio=function(M,D,N){const B=w.relativeLuminance(M>>8),U=w.relativeLuminance(D>>8);if(S(B,U)<N){if(U<B){const H=C(M,D,N),J=S(B,w.relativeLuminance(H>>8));if(J<N){const Q=O(M,D,N);return J>S(B,w.relativeLuminance(Q>>8))?H:Q}return H}const Y=O(M,D,N),K=S(B,w.relativeLuminance(Y>>8));if(K<N){const H=C(M,D,N);return K>S(B,w.relativeLuminance(H>>8))?Y:H}return Y}},b.reduceLuminance=C,b.increaseLuminance=O,b.toChannels=function(M){return[M>>24&255,M>>16&255,M>>8&255,255&M]}})(v||(o.rgba=v={})),o.toPaddedHex=x,o.contrastRatio=S},8969:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=u(844),p=u(2585),f=u(4348),m=u(7866),g=u(744),_=u(7302),w=u(6975),v=u(8460),x=u(1753),S=u(1480),b=u(7994),C=u(9282),O=u(5435),M=u(5981),D=u(2660);let N=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((Y=>{this._onScrollApi?.fire(Y.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(Y){for(const K in Y)this.optionsService.options[K]=Y[K]}constructor(Y){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new _.OptionsService(Y)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(x.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(S.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new O.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new M.WriteBuffer(((K,H)=>this._inputHandler.parse(K,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(Y,K){this._writeBuffer.write(Y,K)}writeSync(Y,K){this._logService.logLevel<=p.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(Y,K)}input(Y,K=!0){this.coreService.triggerDataEvent(Y,K)}resize(Y,K){isNaN(Y)||isNaN(K)||(Y=Math.max(Y,g.MINIMUM_COLS),K=Math.max(K,g.MINIMUM_ROWS),this._bufferService.resize(Y,K))}scroll(Y,K=!1){this._bufferService.scroll(Y,K)}scrollLines(Y,K,H){this._bufferService.scrollLines(Y,K,H)}scrollPages(Y){this.scrollLines(Y*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(Y){const K=Y-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(Y,K){return this._inputHandler.registerEscHandler(Y,K)}registerDcsHandler(Y,K){return this._inputHandler.registerDcsHandler(Y,K)}registerCsiHandler(Y,K){return this._inputHandler.registerCsiHandler(Y,K)}registerOscHandler(Y,K){return this._inputHandler.registerOscHandler(Y,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let Y=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?Y=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(Y=!0),Y?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const Y=[];Y.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),Y.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const K of Y)K.dispose()}))}}}o.CoreTerminal=B},8460:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,h){return u((p=>h.fire(p)))},o.runAndSubscribe=function(u,h){return h(void 0),u((p=>h(p)))}},5435:function(l,o,u){var h=this&&this.__decorate||function(ne,P,L,F){var $,W=arguments.length,ye=W<3?P:F===null?F=Object.getOwnPropertyDescriptor(P,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ye=Reflect.decorate(ne,P,L,F);else for(var be=ne.length-1;be>=0;be--)($=ne[be])&&(ye=(W<3?$(ye):W>3?$(P,L,ye):$(P,L))||ye);return W>3&&ye&&Object.defineProperty(P,L,ye),ye},p=this&&this.__param||function(ne,P){return function(L,F){P(L,F,ne)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=u(2584),m=u(7116),g=u(2015),_=u(844),w=u(482),v=u(8437),x=u(8460),S=u(643),b=u(511),C=u(3734),O=u(2585),M=u(1480),D=u(6242),N=u(6351),B=u(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Y=131072;function K(ne,P){if(ne>24)return P.setWinLines||!1;switch(ne){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var H;(function(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let J=0;class Q extends _.Disposable{getAttrData(){return this._curAttrData}constructor(P,L,F,$,W,ye,be,Ne,le=new g.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=L,this._coreService=F,this._logService=$,this._optionsService=W,this._oscLinkService=ye,this._coreMouseService=be,this._unicodeService=Ne,this._parser=le,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new x.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new x.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new x.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new x.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new x.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new x.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new x.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new x.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new x.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new x.EventEmitter),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 Z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((ee=>this._activeBuffer=ee.activeBuffer))),this._parser.setCsiHandlerFallback(((ee,Ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(ee),params:Ce.toArray()})})),this._parser.setEscHandlerFallback((ee=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(ee)})})),this._parser.setExecuteHandlerFallback((ee=>{this._logService.debug("Unknown EXECUTE code: ",{code:ee})})),this._parser.setOscHandlerFallback(((ee,Ce,xe)=>{this._logService.debug("Unknown OSC code: ",{identifier:ee,action:Ce,data:xe})})),this._parser.setDcsHandlerFallback(((ee,Ce,xe)=>{Ce==="HOOK"&&(xe=xe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(ee),action:Ce,payload:xe})})),this._parser.setPrintHandler(((ee,Ce,xe)=>this.print(ee,Ce,xe))),this._parser.registerCsiHandler({final:"@"},(ee=>this.insertChars(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(ee=>this.scrollLeft(ee))),this._parser.registerCsiHandler({final:"A"},(ee=>this.cursorUp(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(ee=>this.scrollRight(ee))),this._parser.registerCsiHandler({final:"B"},(ee=>this.cursorDown(ee))),this._parser.registerCsiHandler({final:"C"},(ee=>this.cursorForward(ee))),this._parser.registerCsiHandler({final:"D"},(ee=>this.cursorBackward(ee))),this._parser.registerCsiHandler({final:"E"},(ee=>this.cursorNextLine(ee))),this._parser.registerCsiHandler({final:"F"},(ee=>this.cursorPrecedingLine(ee))),this._parser.registerCsiHandler({final:"G"},(ee=>this.cursorCharAbsolute(ee))),this._parser.registerCsiHandler({final:"H"},(ee=>this.cursorPosition(ee))),this._parser.registerCsiHandler({final:"I"},(ee=>this.cursorForwardTab(ee))),this._parser.registerCsiHandler({final:"J"},(ee=>this.eraseInDisplay(ee,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(ee=>this.eraseInDisplay(ee,!0))),this._parser.registerCsiHandler({final:"K"},(ee=>this.eraseInLine(ee,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(ee=>this.eraseInLine(ee,!0))),this._parser.registerCsiHandler({final:"L"},(ee=>this.insertLines(ee))),this._parser.registerCsiHandler({final:"M"},(ee=>this.deleteLines(ee))),this._parser.registerCsiHandler({final:"P"},(ee=>this.deleteChars(ee))),this._parser.registerCsiHandler({final:"S"},(ee=>this.scrollUp(ee))),this._parser.registerCsiHandler({final:"T"},(ee=>this.scrollDown(ee))),this._parser.registerCsiHandler({final:"X"},(ee=>this.eraseChars(ee))),this._parser.registerCsiHandler({final:"Z"},(ee=>this.cursorBackwardTab(ee))),this._parser.registerCsiHandler({final:"`"},(ee=>this.charPosAbsolute(ee))),this._parser.registerCsiHandler({final:"a"},(ee=>this.hPositionRelative(ee))),this._parser.registerCsiHandler({final:"b"},(ee=>this.repeatPrecedingCharacter(ee))),this._parser.registerCsiHandler({final:"c"},(ee=>this.sendDeviceAttributesPrimary(ee))),this._parser.registerCsiHandler({prefix:">",final:"c"},(ee=>this.sendDeviceAttributesSecondary(ee))),this._parser.registerCsiHandler({final:"d"},(ee=>this.linePosAbsolute(ee))),this._parser.registerCsiHandler({final:"e"},(ee=>this.vPositionRelative(ee))),this._parser.registerCsiHandler({final:"f"},(ee=>this.hVPosition(ee))),this._parser.registerCsiHandler({final:"g"},(ee=>this.tabClear(ee))),this._parser.registerCsiHandler({final:"h"},(ee=>this.setMode(ee))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(ee=>this.setModePrivate(ee))),this._parser.registerCsiHandler({final:"l"},(ee=>this.resetMode(ee))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(ee=>this.resetModePrivate(ee))),this._parser.registerCsiHandler({final:"m"},(ee=>this.charAttributes(ee))),this._parser.registerCsiHandler({final:"n"},(ee=>this.deviceStatus(ee))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(ee=>this.deviceStatusPrivate(ee))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(ee=>this.softReset(ee))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(ee=>this.setCursorStyle(ee))),this._parser.registerCsiHandler({final:"r"},(ee=>this.setScrollRegion(ee))),this._parser.registerCsiHandler({final:"s"},(ee=>this.saveCursor(ee))),this._parser.registerCsiHandler({final:"t"},(ee=>this.windowOptions(ee))),this._parser.registerCsiHandler({final:"u"},(ee=>this.restoreCursor(ee))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(ee=>this.insertColumns(ee))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(ee=>this.deleteColumns(ee))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(ee=>this.selectProtected(ee))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(ee=>this.requestMode(ee,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(ee=>this.requestMode(ee,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((ee=>(this.setTitle(ee),this.setIconName(ee),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((ee=>this.setIconName(ee)))),this._parser.registerOscHandler(2,new D.OscHandler((ee=>this.setTitle(ee)))),this._parser.registerOscHandler(4,new D.OscHandler((ee=>this.setOrReportIndexedColor(ee)))),this._parser.registerOscHandler(8,new D.OscHandler((ee=>this.setHyperlink(ee)))),this._parser.registerOscHandler(10,new D.OscHandler((ee=>this.setOrReportFgColor(ee)))),this._parser.registerOscHandler(11,new D.OscHandler((ee=>this.setOrReportBgColor(ee)))),this._parser.registerOscHandler(12,new D.OscHandler((ee=>this.setOrReportCursorColor(ee)))),this._parser.registerOscHandler(104,new D.OscHandler((ee=>this.restoreIndexedColor(ee)))),this._parser.registerOscHandler(110,new D.OscHandler((ee=>this.restoreFgColor(ee)))),this._parser.registerOscHandler(111,new D.OscHandler((ee=>this.restoreBgColor(ee)))),this._parser.registerOscHandler(112,new D.OscHandler((ee=>this.restoreCursorColor(ee)))),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(const ee in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:ee},(()=>this.selectCharset("("+ee))),this._parser.registerEscHandler({intermediates:")",final:ee},(()=>this.selectCharset(")"+ee))),this._parser.registerEscHandler({intermediates:"*",final:ee},(()=>this.selectCharset("*"+ee))),this._parser.registerEscHandler({intermediates:"+",final:ee},(()=>this.selectCharset("+"+ee))),this._parser.registerEscHandler({intermediates:"-",final:ee},(()=>this.selectCharset("-"+ee))),this._parser.registerEscHandler({intermediates:".",final:ee},(()=>this.selectCharset("."+ee))),this._parser.registerEscHandler({intermediates:"/",final:ee},(()=>this.selectCharset("/"+ee)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((ee=>(this._logService.error("Parsing error: ",ee),ee))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((ee,Ce)=>this.requestStatusString(ee,Ce))))}_preserveStack(P,L,F,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=$}_logSlowResolvingAsync(P){this._logService.logLevel<=O.LogLevelEnum.WARN&&Promise.race([P,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(P,L){let F,$=this._activeBuffer.x,W=this._activeBuffer.y,ye=0;const be=this._parseStack.paused;if(be){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;$=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>Y&&(ye=this._parseStack.position+Y)}if(this._logService.logLevel<=O.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,(ee=>String.fromCharCode(ee))).join("")}"`),typeof P=="string"?P.split("").map((ee=>ee.charCodeAt(0))):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<Y&&(this._parseBuffer=new Uint32Array(Math.min(P.length,Y))),be||this._dirtyRowTracker.clearRange(),P.length>Y)for(let ee=ye;ee<P.length;ee+=Y){const Ce=ee+Y<P.length?ee+Y:P.length,xe=typeof P=="string"?this._stringDecoder.decode(P.substring(ee,Ce),this._parseBuffer):this._utf8Decoder.decode(P.subarray(ee,Ce),this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,xe))return this._preserveStack($,W,xe,ee),this._logSlowResolvingAsync(F),F}else if(!be){const ee=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,ee))return this._preserveStack($,W,ee,0),this._logSlowResolvingAsync(F),F}this._activeBuffer.x===$&&this._activeBuffer.y===W||this._onCursorMove.fire();const Ne=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),le=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);le<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(le,this._bufferService.rows-1),Math.min(Ne,this._bufferService.rows-1))}print(P,L,F){let $,W;const ye=this._charsetService.charset,be=this._optionsService.rawOptions.screenReaderMode,Ne=this._bufferService.cols,le=this._coreService.decPrivateModes.wraparound,ee=this._coreService.modes.insertMode,Ce=this._curAttrData;let xe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&F-L>0&&xe.getWidth(this._activeBuffer.x-1)===2&&xe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Ce);let Ze=this._parser.precedingJoinState;for(let De=L;De<F;++De){if($=P[De],$<127&&ye){const ze=ye[String.fromCharCode($)];ze&&($=ze.charCodeAt(0))}const wt=this._unicodeService.charProperties($,Ze);W=M.UnicodeService.extractWidth(wt);const Fe=M.UnicodeService.extractShouldJoin(wt),qe=Fe?M.UnicodeService.extractWidth(Ze):0;if(Ze=wt,be&&this._onA11yChar.fire((0,w.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-qe>Ne){if(le){const ze=xe;let Ue=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,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),xe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&xe instanceof v.BufferLine&&xe.copyCellsFrom(ze,Ue,0,qe,!1);Ue<Ne;)ze.setCellFromCodepoint(Ue++,0,1,Ce)}else if(this._activeBuffer.x=Ne-1,W===2)continue}if(Fe&&this._activeBuffer.x){const ze=xe.getWidth(this._activeBuffer.x-1)?1:2;xe.addCodepointToCell(this._activeBuffer.x-ze,$,W);for(let Ue=W-qe;--Ue>=0;)xe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ce)}else if(ee&&(xe.insertCells(this._activeBuffer.x,W-qe,this._activeBuffer.getNullCell(Ce)),xe.getWidth(Ne-1)===2&&xe.setCellFromCodepoint(Ne-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,Ce)),xe.setCellFromCodepoint(this._activeBuffer.x++,$,W,Ce),W>0)for(;--W;)xe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ce)}this._parser.precedingJoinState=Ze,this._activeBuffer.x<Ne&&F-L>0&&xe.getWidth(this._activeBuffer.x)===0&&!xe.hasContent(this._activeBuffer.x)&&xe.setCellFromCodepoint(this._activeBuffer.x,0,1,Ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(P,L){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,L):this._parser.registerCsiHandler(P,(F=>!K(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(P,L){return this._parser.registerDcsHandler(P,new N.DcsHandler(L))}registerEscHandler(P,L){return this._parser.registerEscHandler(P,L)}registerOscHandler(P,L){return this._parser.registerOscHandler(P,new D.OscHandler(L))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,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(P,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=P,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+L)}cursorUp(P){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const L=P.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=P.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=P.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const L=P.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,L,F,$=!1,W=!1){const ye=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);ye.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),W),$&&(ye.isWrapped=!1)}_resetBufferLine(P,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),F.isWrapped=!1)}eraseInDisplay(P,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F<this._bufferService.rows;F++)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(F);break;case 1:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(P,L=!1){switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(P){this._restrictCursor();let L=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;L--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(P){this._restrictCursor();let L=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;L--;)this._activeBuffer.lines.splice(F,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let L=P.params[0]||1;for(;L--;)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(P){let L=P.params[0]||1;for(;L--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);$.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);$.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);$.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);$.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const L=this._parser.precedingJoinState;if(!L)return!0;const F=P.params[0]||1,$=M.UnicodeService.extractWidth(L),W=this._activeBuffer.x-$,ye=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),be=new Uint32Array(ye.length*F);let Ne=0;for(let ee=0;ee<ye.length;){const Ce=ye.codePointAt(ee)||0;be[Ne++]=Ce,ee+=Ce>65535?2:1}let le=Ne;for(let ee=1;ee<F;++ee)be.copyWithin(le,0,Ne),le+=Ne;return this.print(be,0,le),!0}sendDeviceAttributesPrimary(P){return P.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(P){return P.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let L=0;L<P.length;L++)switch(P.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let L=0;L<P.length;L++)switch(P.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(P){for(let L=0;L<P.length;L++)switch(P.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let L=0;L<P.length;L++)switch(P.params[L]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),P.params[L]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(P,L){const F=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:W}=this._coreMouseService,ye=this._coreService,{buffers:be,cols:Ne}=this._bufferService,{active:le,alt:ee}=be,Ce=this._optionsService.rawOptions,xe=Fe=>Fe?1:2,Ze=P.params[0];return De=Ze,wt=L?Ze===2?4:Ze===4?xe(ye.modes.insertMode):Ze===12?3:Ze===20?xe(Ce.convertEol):0:Ze===1?xe(F.applicationCursorKeys):Ze===3?Ce.windowOptions.setWinLines?Ne===80?2:Ne===132?1:0:0:Ze===6?xe(F.origin):Ze===7?xe(F.wraparound):Ze===8?3:Ze===9?xe($==="X10"):Ze===12?xe(Ce.cursorBlink):Ze===25?xe(!ye.isCursorHidden):Ze===45?xe(F.reverseWraparound):Ze===66?xe(F.applicationKeypad):Ze===67?4:Ze===1e3?xe($==="VT200"):Ze===1002?xe($==="DRAG"):Ze===1003?xe($==="ANY"):Ze===1004?xe(F.sendFocus):Ze===1005?4:Ze===1006?xe(W==="SGR"):Ze===1015?4:Ze===1016?xe(W==="SGR_PIXELS"):Ze===1048?1:Ze===47||Ze===1047||Ze===1049?xe(le===ee):Ze===2004?xe(F.bracketedPasteMode):0,ye.triggerDataEvent(`${f.C0.ESC}[${L?"":"?"}${De};${wt}$y`),!0;var De,wt}_updateAttrColor(P,L,F,$,W){return L===2?(P|=50331648,P&=-16777216,P|=C.AttributeData.fromColorRGB([F,$,W])):L===5&&(P&=-50331904,P|=33554432|255&F),P}_extractColor(P,L,F){const $=[0,0,-1,0,0,0];let W=0,ye=0;do{if($[ye+W]=P.params[L+ye],P.hasSubParams(L+ye)){const be=P.getSubParams(L+ye);let Ne=0;do $[1]===5&&(W=1),$[ye+Ne+1+W]=be[Ne];while(++Ne<be.length&&Ne+ye+1+W<$.length);break}if($[1]===5&&ye+W>=2||$[1]===2&&ye+W>=5)break;$[1]&&(W=1)}while(++ye+L<P.length&&ye+W<$.length);for(let be=2;be<$.length;++be)$[be]===-1&&($[be]=0);switch($[0]){case 38:F.fg=this._updateAttrColor(F.fg,$[1],$[3],$[4],$[5]);break;case 48:F.bg=this._updateAttrColor(F.bg,$[1],$[3],$[4],$[5]);break;case 58:F.extended=F.extended.clone(),F.extended.underlineColor=this._updateAttrColor(F.extended.underlineColor,$[1],$[3],$[4],$[5])}return ye}_processUnderline(P,L){L.extended=L.extended.clone(),(!~P||P>5)&&(P=1),L.extended.underlineStyle=P,L.fg|=268435456,P===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(P){P.fg=v.DEFAULT_ATTR_DATA.fg,P.bg=v.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=P.length;let F;const $=this._curAttrData;for(let W=0;W<L;W++)F=P.params[W],F>=30&&F<=37?($.fg&=-50331904,$.fg|=16777216|F-30):F>=40&&F<=47?($.bg&=-50331904,$.bg|=16777216|F-40):F>=90&&F<=97?($.fg&=-50331904,$.fg|=16777224|F-90):F>=100&&F<=107?($.bg&=-50331904,$.bg|=16777224|F-100):F===0?this._processSGR0($):F===1?$.fg|=134217728:F===3?$.bg|=67108864:F===4?($.fg|=268435456,this._processUnderline(P.hasSubParams(W)?P.getSubParams(W)[0]:1,$)):F===5?$.fg|=536870912:F===7?$.fg|=67108864:F===8?$.fg|=1073741824:F===9?$.fg|=2147483648:F===2?$.bg|=134217728:F===21?this._processUnderline(2,$):F===22?($.fg&=-134217729,$.bg&=-134217729):F===23?$.bg&=-67108865:F===24?($.fg&=-268435457,this._processUnderline(0,$)):F===25?$.fg&=-536870913:F===27?$.fg&=-67108865:F===28?$.fg&=-1073741825:F===29?$.fg&=2147483647:F===39?($.fg&=-67108864,$.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?($.bg&=-67108864,$.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?W+=this._extractColor(P,W,$):F===53?$.bg|=1073741824:F===55?$.bg&=-1073741825:F===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):F===100?($.fg&=-67108864,$.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${L};${F}R`)}return!0}softReset(P){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.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(P){const L=P.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(P){const L=P.params[0]||1;let F;return(P.length<2||(F=P.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(P){if(!K(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(P){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(P){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(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const L=[],F=P.split(";");for(;F.length>1;){const $=F.shift(),W=F.shift();if(/^\d+$/.exec($)){const ye=parseInt($);if(ie(ye))if(W==="?")L.push({type:0,index:ye});else{const be=(0,B.parseColor)(W);be&&L.push({type:1,index:ye,color:be})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(P){const L=P.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(P,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=P.split(":");let $;const W=F.findIndex((ye=>ye.startsWith("id=")));return W!==-1&&($=F[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(P,L){const F=P.split(";");for(let $=0;$<F.length&&!(L>=this._specialColors.length);++$,++L)if(F[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const W=(0,B.parseColor)(F[$]);W&&this._onColor.fire([{type:1,index:this._specialColors[L],color:W}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const L=[],F=P.split(";");for(let $=0;$<F.length;++$)if(/^\d+$/.exec(F[$])){const W=parseInt(F[$]);ie(W)&&L.push({type:2,index:W})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){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,m.DEFAULT_CHARSET),!0}selectCharset(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(U[P[0]],m.CHARSETS[P[1]]||m.DEFAULT_CHARSET),!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){const P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new b.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const F=this._activeBuffer.ybase+this._activeBuffer.y+L,$=this._activeBuffer.lines.get(F);$&&($.fill(P),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,L){const F=this._bufferService.buffer,$=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,L){this._dirtyRowTracker.markRangeDirty(P,L)}}o.InputHandler=Q;let Z=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,P){ne>P&&(J=ne,ne=P,P=J),ne<this.start&&(this.start=ne),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ie(ne){return 0<=ne&&ne<256}Z=h([p(0,O.IBufferService)],Z)},844:(l,o)=>{function u(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=u,o.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(p,f,m){this._data[p]||(this._data[p]={}),this._data[p][f]=m}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=u,o.FourKeyMap=class{constructor(){this._data=new u}set(h,p,f,m,g){this._data.get(h,p)||this._data.set(h,p,new u),this._data.get(h,p).set(f,m,g)}get(h,p,f,m){return this._data.get(h,p)?.get(f,m)}clear(){this._data.clear()}}},6114:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const u=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=u.includes("Firefox"),o.isLegacyEdge=u.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(u),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=u.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(u)},6106:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let u=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const p=this._getKey(h);if(p===void 0||(u=this._search(p),u===-1)||this._getKey(this._array[u])!==p)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===p);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,p){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do p(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let p=0,f=this._array.length-1;for(;f>=p;){let m=p+f>>1;const g=this._getKey(this._array[m]);if(g>h)f=m-1;else{if(!(g<h)){for(;m>0&&this._getKey(this._array[m-1])===h;)m--;return m}p=m+1}}return p}}},7226:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=u(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let _=0,w=0,v=g.timeRemaining(),x=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),w=Math.max(_,w),x=g.timeRemaining(),1.5*w>x)return v-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-_))}ms`),void this._start();v=x}this.clear()}}class f extends p{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const _=Date.now()+g;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=u(643);o.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),m=f?.get(p.cols-1),g=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);g&&m&&(g.isWrapped=m[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&m[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,m=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=m}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=u(6349),p=u(7226),f=u(3734),m=u(8437),g=u(4634),_=u(511),w=u(643),v=u(4863),x=u(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(S,b,C){this._hasScrollback=S,this._optionsService=b,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=x.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(S){return S?(this._nullCell.fg=S.fg,this._nullCell.bg=S.bg,this._nullCell.extended=S.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(S){return S?(this._whitespaceCell.fg=S.fg,this._whitespaceCell.bg=S.bg,this._whitespaceCell.extended=S.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(S,b){return new m.BufferLine(this._bufferService.cols,this.getNullCell(S),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const S=this.ybase+this.y-this.ydisp;return S>=0&&S<this._rows}_getCorrectBufferLength(S){if(!this._hasScrollback)return S;const b=S+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(S){if(this.lines.length===0){S===void 0&&(S=m.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(S))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(S,b){const C=this.getNullCell(m.DEFAULT_ATTR_DATA);let O=0;const M=this._getCorrectBufferLength(b);if(M>this.lines.maxLength&&(this.lines.maxLength=M),this.lines.length>0){if(this._cols<S)for(let N=0;N<this.lines.length;N++)O+=+this.lines.get(N).resize(S,C);let D=0;if(this._rows<b)for(let N=this._rows;N<b;N++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(S,C)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(S,C)));else for(let N=this._rows;N>b;N--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(M<this.lines.maxLength){const N=this.lines.length-M;N>0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=M}this.x=Math.min(this.x,S-1),this.y=Math.min(this.y,b-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,S-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(S,b),this._cols>S))for(let D=0;D<this.lines.length;D++)O+=+this.lines.get(D).resize(S,C);this._cols=S,this._rows=b,this._memoryCleanupQueue.clear(),O>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let S=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,S=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return S}get _isReflowEnabled(){const S=this._optionsService.rawOptions.windowsPty;return S&&S.buildNumber?this._hasScrollback&&S.backend==="conpty"&&S.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(S,b){this._cols!==S&&(S>this._cols?this._reflowLarger(S,b):this._reflowSmaller(S,b))}_reflowLarger(S,b){const C=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,S,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(C.length>0){const O=(0,g.reflowLargerCreateNewLayout)(this.lines,C);(0,g.reflowLargerApplyNewLayout)(this.lines,O.layout),this._reflowLargerAdjustViewport(S,b,O.countRemoved)}}_reflowLargerAdjustViewport(S,b,C){const O=this.getNullCell(m.DEFAULT_ATTR_DATA);let M=C;for(;M-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new m.BufferLine(S,O))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-C,0)}_reflowSmaller(S,b){const C=this.getNullCell(m.DEFAULT_ATTR_DATA),O=[];let M=0;for(let D=this.lines.length-1;D>=0;D--){let N=this.lines.get(D);if(!N||!N.isWrapped&&N.getTrimmedLength()<=S)continue;const B=[N];for(;N.isWrapped&&D>0;)N=this.lines.get(--D),B.unshift(N);const U=this.ybase+this.y;if(U>=D&&U<D+B.length)continue;const Y=B[B.length-1].getTrimmedLength(),K=(0,g.reflowSmallerGetNewLineLengths)(B,this._cols,S),H=K.length-B.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const Q=[];for(let F=0;F<H;F++){const $=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);Q.push($)}Q.length>0&&(O.push({start:D+B.length+M,newLines:Q}),M+=Q.length),B.push(...Q);let Z=K.length-1,ie=K[Z];ie===0&&(Z--,ie=K[Z]);let ne=B.length-H-1,P=Y;for(;ne>=0;){const F=Math.min(P,ie);if(B[Z]===void 0)break;if(B[Z].copyCellsFrom(B[ne],P-F,ie-F,F,!0),ie-=F,ie===0&&(Z--,ie=K[Z]),P-=F,P===0){ne--;const $=Math.max(ne,0);P=(0,g.getWrappedLineTrimmedLength)(B,$,this._cols)}}for(let F=0;F<B.length;F++)K[F]<S&&B[F].setCell(K[F],C);let L=H-J;for(;L-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+M)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+b-1)}if(O.length>0){const D=[],N=[];for(let Z=0;Z<this.lines.length;Z++)N.push(this.lines.get(Z));const B=this.lines.length;let U=B-1,Y=0,K=O[Y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+M);let H=0;for(let Z=Math.min(this.lines.maxLength-1,B+M-1);Z>=0;Z--)if(K&&K.start>U+H){for(let ie=K.newLines.length-1;ie>=0;ie--)this.lines.set(Z--,K.newLines[ie]);Z++,D.push({index:U+1,amount:K.newLines.length}),H+=K.newLines.length,K=O[++Y]}else this.lines.set(Z,N[U--]);let J=0;for(let Z=D.length-1;Z>=0;Z--)D[Z].index+=J,this.lines.onInsertEmitter.fire(D[Z]),J+=D[Z].amount;const Q=Math.max(0,B+M-this.lines.maxLength);Q>0&&this.lines.onTrimEmitter.fire(Q)}}translateBufferLineToString(S,b,C=0,O){const M=this.lines.get(S);return M?M.translateToString(b,C,O):""}getWrappedRangeForLine(S){let b=S,C=S;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;C+1<this.lines.length&&this.lines.get(C+1).isWrapped;)C++;return{first:b,last:C}}setupTabStops(S){for(S!=null?this.tabs[S]||(S=this.prevStop(S)):(this.tabs={},S=0);S<this._cols;S+=this._optionsService.rawOptions.tabStopWidth)this.tabs[S]=!0}prevStop(S){for(S==null&&(S=this.x);!this.tabs[--S]&&S>0;);return S>=this._cols?this._cols-1:S<0?0:S}nextStop(S){for(S==null&&(S=this.x);!this.tabs[++S]&&S<this._cols;);return S>=this._cols?this._cols-1:S<0?0:S}clearMarkers(S){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===S&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].dispose(),this.markers.splice(S--,1);this._isClearing=!1}addMarker(S){const b=new v.Marker(S);return this.markers.push(b),b.register(this.lines.onTrim((C=>{b.line-=C,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((C=>{b.line>=C.index&&(b.line+=C.amount)}))),b.register(this.lines.onDelete((C=>{b.line>=C.index&&b.line<C.index+C.amount&&b.dispose(),b.line>C.index&&(b.line-=C.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(S){this._isClearing||this.markers.splice(this.markers.indexOf(S),1)}}},8437:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=u(3734),p=u(511),f=u(643),m=u(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let g=0;class _{constructor(v,x,S=!1){this.isWrapped=S,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const b=x||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C<v;++C)this.setCell(C,b);this.length=v}get(v){const x=this._data[3*v+0],S=2097151&x;return[this._data[3*v+1],2097152&x?this._combined[v]:S?(0,m.stringFromCodePoint)(S):"",x>>22,2097152&x?this._combined[v].charCodeAt(this._combined[v].length-1):S]}set(v,x){this._data[3*v+1]=x[f.CHAR_DATA_ATTR_INDEX],x[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=x[1],this._data[3*v+0]=2097152|v|x[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const x=this._data[3*v+0];return 2097152&x?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&x}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const x=this._data[3*v+0];return 2097152&x?this._combined[v]:2097151&x?(0,m.stringFromCodePoint)(2097151&x):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,x){return g=3*v,x.content=this._data[g+0],x.fg=this._data[g+1],x.bg=this._data[g+2],2097152&x.content&&(x.combinedData=this._combined[v]),268435456&x.bg&&(x.extended=this._extendedAttrs[v]),x}setCell(v,x){2097152&x.content&&(this._combined[v]=x.combinedData),268435456&x.bg&&(this._extendedAttrs[v]=x.extended),this._data[3*v+0]=x.content,this._data[3*v+1]=x.fg,this._data[3*v+2]=x.bg}setCellFromCodepoint(v,x,S,b){268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=x|S<<22,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}addCodepointToCell(v,x,S){let b=this._data[3*v+0];2097152&b?this._combined[v]+=(0,m.stringFromCodePoint)(x):2097151&b?(this._combined[v]=(0,m.stringFromCodePoint)(2097151&b)+(0,m.stringFromCodePoint)(x),b&=-2097152,b|=2097152):b=x|4194304,S&&(b&=-12582913,b|=S<<22),this._data[3*v+0]=b}insertCells(v,x,S){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length-v){const b=new p.CellData;for(let C=this.length-v-x-1;C>=0;--C)this.setCell(v+x+C,this.loadCell(v+C,b));for(let C=0;C<x;++C)this.setCell(v+C,S)}else for(let b=v;b<this.length;++b)this.setCell(b,S);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,S)}deleteCells(v,x,S){if(v%=this.length,x<this.length-v){const b=new p.CellData;for(let C=0;C<this.length-v-x;++C)this.setCell(v+C,this.loadCell(v+x+C,b));for(let C=this.length-x;C<this.length;++C)this.setCell(C,S)}else for(let b=v;b<this.length;++b)this.setCell(b,S);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,S)}replaceCells(v,x,S,b=!1){if(b)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length&&this.getWidth(x-1)===2&&!this.isProtected(x)&&this.setCellFromCodepoint(x,0,1,S);v<x&&v<this.length;)this.isProtected(v)||this.setCell(v,S),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,S),x<this.length&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x,0,1,S);v<x&&v<this.length;)this.setCell(v++,S)}resize(v,x){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const S=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*S)this._data=new Uint32Array(this._data.buffer,0,S);else{const b=new Uint32Array(S);b.set(this._data),this._data=b}for(let b=this.length;b<v;++b)this.setCell(b,x)}else{this._data=this._data.subarray(0,S);const b=Object.keys(this._combined);for(let O=0;O<b.length;O++){const M=parseInt(b[O],10);M>=v&&delete this._combined[M]}const C=Object.keys(this._extendedAttrs);for(let O=0;O<C.length;O++){const M=parseInt(C[O],10);M>=v&&delete this._extendedAttrs[M]}}return this.length=v,4*S*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,x=!1){if(x)for(let S=0;S<this.length;++S)this.isProtected(S)||this.setCell(S,v);else{this._combined={},this._extendedAttrs={};for(let S=0;S<this.length;++S)this.setCell(S,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const x in v._combined)this._combined[x]=v._combined[x];this._extendedAttrs={};for(const x in v._extendedAttrs)this._extendedAttrs[x]=v._extendedAttrs[x];this.isWrapped=v.isWrapped}clone(){const v=new _(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const x in this._combined)v._combined[x]=this._combined[x];for(const x in this._extendedAttrs)v._extendedAttrs[x]=this._extendedAttrs[x];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,x,S,b,C){const O=v._data;if(C)for(let D=b-1;D>=0;D--){for(let N=0;N<3;N++)this._data[3*(S+D)+N]=O[3*(x+D)+N];268435456&O[3*(x+D)+2]&&(this._extendedAttrs[S+D]=v._extendedAttrs[x+D])}else for(let D=0;D<b;D++){for(let N=0;N<3;N++)this._data[3*(S+D)+N]=O[3*(x+D)+N];268435456&O[3*(x+D)+2]&&(this._extendedAttrs[S+D]=v._extendedAttrs[x+D])}const M=Object.keys(v._combined);for(let D=0;D<M.length;D++){const N=parseInt(M[D],10);N>=x&&(this._combined[N-x+S]=v._combined[N])}}translateToString(v,x,S,b){x=x??0,S=S??this.length,v&&(S=Math.min(S,this.getTrimmedLength())),b&&(b.length=0);let C="";for(;x<S;){const O=this._data[3*x+0],M=2097151&O,D=2097152&O?this._combined[x]:M?(0,m.stringFromCodePoint)(M):f.WHITESPACE_CELL_CHAR;if(C+=D,b)for(let N=0;N<D.length;++N)b.push(x);x+=O>>22||1}return b&&b.push(x),C}}o.BufferLine=_},4841:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(l,o)=>{function u(h,p,f){if(p===h.length-1)return h[p].getTrimmedLength();const m=!h[p].hasContent(f-1)&&h[p].getWidth(f-1)===1,g=h[p+1].getWidth(0)===2;return m&&g?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,p,f,m,g){const _=[];for(let w=0;w<h.length-1;w++){let v=w,x=h.get(++v);if(!x.isWrapped)continue;const S=[h.get(w)];for(;v<h.length&&x.isWrapped;)S.push(x),x=h.get(++v);if(m>=w&&m<v){w+=S.length-1;continue}let b=0,C=u(S,b,p),O=1,M=0;for(;O<S.length;){const N=u(S,O,p),B=N-M,U=f-C,Y=Math.min(B,U);S[b].copyCellsFrom(S[O],M,C,Y,!1),C+=Y,C===f&&(b++,C=0),M+=Y,M===N&&(O++,M=0),C===0&&b!==0&&S[b-1].getWidth(f-1)===2&&(S[b].copyCellsFrom(S[b-1],f-1,C++,1,!1),S[b-1].setCell(f-1,g))}S[b].replaceCells(C,f,g);let D=0;for(let N=S.length-1;N>0&&(N>b||S[N].getTrimmedLength()===0);N--)D++;D>0&&(_.push(w+S.length-D),_.push(D)),w+=S.length-1}return _},o.reflowLargerCreateNewLayout=function(h,p){const f=[];let m=0,g=p[m],_=0;for(let w=0;w<h.length;w++)if(g===w){const v=p[++m];h.onDeleteEmitter.fire({index:w-_,amount:v}),w+=v-1,_+=v,g=p[++m]}else f.push(w);return{layout:f,countRemoved:_}},o.reflowLargerApplyNewLayout=function(h,p){const f=[];for(let m=0;m<p.length;m++)f.push(h.get(p[m]));for(let m=0;m<f.length;m++)h.set(m,f[m]);h.length=p.length},o.reflowSmallerGetNewLineLengths=function(h,p,f){const m=[],g=h.map(((x,S)=>u(h,S,p))).reduce(((x,S)=>x+S));let _=0,w=0,v=0;for(;v<g;){if(g-v<f){m.push(g-v);break}_+=f;const x=u(h,w,p);_>x&&(_-=x,w++);const S=h[w].getWidth(_-1)===2;S&&_--;const b=S?f-1:f;m.push(b),v+=b}return m},o.getWrappedLineTrimmedLength=u},5295:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=u(8460),p=u(844),f=u(9092);class m extends p.Disposable{constructor(_,w){super(),this._optionsService=_,this._bufferService=w,this._onBufferActivate=this.register(new h.EventEmitter),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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!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(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),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(_,w){this._normal.resize(_,w),this._alt.resize(_,w),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}o.BufferSet=m},511:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=u(482),p=u(643),f=u(3734);class m extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const w=new m;return w.setFromCharData(_),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(_){this.fg=_[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(_[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(_[p.CHAR_DATA_CHAR_INDEX].length===2){const v=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const x=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=x&&x<=57343?this.content=1024*(v-55296)+x-56320+65536|_[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=_[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=_[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=m},643:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=u(8460),p=u(844);class f{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=f,f._nextId=1},7116:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,o)=>{var u,h,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
119
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(o.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(h||(o.C1=h={})),(function(f){f.ST=`${u.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=u(2584),p={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:["'",'"']};o.evaluateKeyboardEvent=function(f,m,g,_){const w={type:0,cancel:!1,key:void 0},v=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=m?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=m?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=m?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=m?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,f.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(g?"b":"[1;5D"))):w.key=m?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(g?"f":"[1;5C"))):w.key=m?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"A",g||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=m?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"B",g||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=m?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=v?h.C0.ESC+"[1;"+(v+1)+"H":m?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=v?h.C0.ESC+"[1;"+(v+1)+"F":m?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=h.C0.ESC+"[5;"+(v+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=h.C0.ESC+"[6;"+(v+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(g&&!_||!f.altKey||f.metaKey)!g||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=h.C0.US),f.key==="@"&&(w.key=h.C0.NUL)):f.keyCode===65&&(w.type=1);else{const x=p[f.keyCode],S=x?.[f.shiftKey?1:0];if(S)w.key=h.C0.ESC+S;else if(f.keyCode>=65&&f.keyCode<=90){const b=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(b);f.shiftKey&&(C=C.toUpperCase()),w.key=h.C0.ESC+C}else if(f.keyCode===32)w.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let b=f.code.slice(3,4);f.shiftKey||(b=b.toLowerCase()),w.key=h.C0.ESC+b,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=h.C0.DEL:f.keyCode===219?w.key=h.C0.ESC:f.keyCode===220?w.key=h.C0.FS:f.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},o.utf32ToString=function(u,h=0,p=u.length){let f="";for(let m=h;m<p;++m){let g=u[m];g>65535?(g-=65536,f+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):f+=String.fromCharCode(g)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const p=u.length;if(!p)return 0;let f=0,m=0;if(this._interim){const g=u.charCodeAt(m++);56320<=g&&g<=57343?h[f++]=1024*(this._interim-55296)+g-56320+65536:(h[f++]=this._interim,h[f++]=g),this._interim=0}for(let g=m;g<p;++g){const _=u.charCodeAt(g);if(55296<=_&&_<=56319){if(++g>=p)return this._interim=_,f;const w=u.charCodeAt(g);56320<=w&&w<=57343?h[f++]=1024*(_-55296)+w-56320+65536:(h[f++]=_,h[f++]=w)}else _!==65279&&(h[f++]=_)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const p=u.length;if(!p)return 0;let f,m,g,_,w=0,v=0,x=0;if(this.interim[0]){let C=!1,O=this.interim[0];O&=(224&O)==192?31:(240&O)==224?15:7;let M,D=0;for(;(M=63&this.interim[++D])&&D<4;)O<<=6,O|=M;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=N-D;for(;x<B;){if(x>=p)return 0;if(M=u[x++],(192&M)!=128){x--,C=!0;break}this.interim[D++]=M,O<<=6,O|=63&M}C||(N===2?O<128?x--:h[w++]=O:N===3?O<2048||O>=55296&&O<=57343||O===65279||(h[w++]=O):O<65536||O>1114111||(h[w++]=O)),this.interim.fill(0)}const S=p-4;let b=x;for(;b<p;){for(;!(!(b<S)||128&(f=u[b])||128&(m=u[b+1])||128&(g=u[b+2])||128&(_=u[b+3]));)h[w++]=f,h[w++]=m,h[w++]=g,h[w++]=_,b+=4;if(f=u[b++],f<128)h[w++]=f;else if((224&f)==192){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(v=(31&f)<<6|63&m,v<128){b--;continue}h[w++]=v}else if((240&f)==224){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,w;if(g=u[b++],(192&g)!=128){b--;continue}if(v=(15&f)<<12|(63&m)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;h[w++]=v}else if((248&f)==240){if(b>=p)return this.interim[0]=f,w;if(m=u[b++],(192&m)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,w;if(g=u[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=g,w;if(_=u[b++],(192&_)!=128){b--;continue}if(v=(7&f)<<18|(63&m)<<12|(63&g)<<6|63&_,v<65536||v>1114111)continue;h[w++]=v}}return w}}},225:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=u(1480),p=[[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]],f=[[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]];let m;o.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<p.length;++g)m.fill(0,p[g][0],p[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(_,w){let v,x=0,S=w.length-1;if(_<w[0][0]||_>w[S][1])return!1;for(;S>=x;)if(v=x+S>>1,_>w[v][1])x=v+1;else{if(!(_<w[v][0]))return!0;S=v-1}return!1})(g,f)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,_){let w=this.wcwidth(g),v=w===0&&_!==0;if(v){const x=h.UnicodeService.extractWidth(_);x===0?v=!1:x>w&&(w=x)}return h.UnicodeService.createPropertyValue(0,w,v)}}},5981:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=u(8460),p=u(844);class f extends p.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,_){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_)}_innerWrite(g=0,_=!0){const w=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],x=this._action(v,_);if(x){const b=C=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(w,C);return void x.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(b)}const S=this._callbacks[this._bufferOffset];if(S&&S(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}o.WriteBuffer=f},5941:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function p(f,m){const g=f.toString(16),_=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}o.parseColor=function(f){if(!f)return;let m=f.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=u.exec(m);if(g){const _=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/_*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/_*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/_*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),h.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,_=[0,0,0];for(let w=0;w<3;++w){const v=parseInt(m.slice(g*w,g*w+g),16);_[w]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return _}},o.toRgbString=function(f,m=16){const[g,_,w]=f;return`rgb:${p(g,m)}/${p(_,m)}/${p(w,m)}`}},5770:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=u(482),p=u(8742),f=u(5770),m=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(_,w){this._handlers[_]===void 0&&(this._handlers[_]=[]);const v=this._handlers[_];return v.push(w),{dispose:()=>{const x=v.indexOf(w);x!==-1&&v.splice(x,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(_,w){if(this.reset(),this._ident=_,this._active=this._handlers[_]||m,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(_,w,v){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(_,w,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(_,w,v))}unhook(_,w=!0){if(this._active.length){let v=!1,x=this._active.length-1,S=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,v=w,S=this._stack.fallThrough,this._stack.paused=!1),!S&&v===!1){for(;x>=0&&(v=this._active[x].unhook(_),v!==!0);x--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,v;x--}for(;x>=0;x--)if(v=this._active[x].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",_);this._active=m,this._ident=0}};const g=new p.Params;g.addParam(0),o.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=g,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():g,this._data="",this._hitLimit=!1}put(_,w,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(_,w,v),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let w=!1;if(this._hitLimit)w=!1;else if(_&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((v=>(this._params=g,this._data="",this._hitLimit=!1,v)));return this._params=g,this._data="",this._hitLimit=!1,w}}},2015:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=u(844),p=u(8742),f=u(6242),m=u(6351);class g{constructor(x){this.table=new Uint8Array(x)}setDefault(x,S){this.table.fill(x<<4|S)}add(x,S,b,C){this.table[S<<8|x]=b<<4|C}addMany(x,S,b,C){for(let O=0;O<x.length;O++)this.table[S<<8|x[O]]=b<<4|C}}o.TransitionTable=g;const _=160;o.VT500_TRANSITION_TABLE=(function(){const v=new g(4095),x=Array.apply(null,Array(256)).map(((D,N)=>N)),S=(D,N)=>x.slice(D,N),b=S(32,127),C=S(0,24);C.push(25),C.push.apply(C,S(28,32));const O=S(0,14);let M;for(M in v.setDefault(1,0),v.addMany(b,0,2,0),O)v.addMany([24,26,153,154],M,3,0),v.addMany(S(128,144),M,3,0),v.addMany(S(144,152),M,3,0),v.add(156,M,0,0),v.add(27,M,11,1),v.add(157,M,4,8),v.addMany([152,158,159],M,0,7),v.add(155,M,11,3),v.add(144,M,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(b,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(S(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(b,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(S(64,127),3,7,0),v.addMany(S(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(S(48,60),4,8,4),v.addMany(S(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(S(32,64),6,0,6),v.add(127,6,0,6),v.addMany(S(64,127),6,0,0),v.addMany(S(32,48),3,9,5),v.addMany(S(32,48),5,9,5),v.addMany(S(48,64),5,0,6),v.addMany(S(64,127),5,7,0),v.addMany(S(32,48),4,9,5),v.addMany(S(32,48),1,9,2),v.addMany(S(32,48),2,9,2),v.addMany(S(48,127),2,10,0),v.addMany(S(48,80),1,10,0),v.addMany(S(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(S(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(S(28,32),9,0,9),v.addMany(S(32,48),9,9,12),v.addMany(S(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(S(32,128),11,0,11),v.addMany(S(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(S(28,32),10,0,10),v.addMany(S(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(S(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(S(28,32),12,0,12),v.addMany(S(32,48),12,9,12),v.addMany(S(48,64),12,0,11),v.addMany(S(64,127),12,12,13),v.addMany(S(64,127),10,12,13),v.addMany(S(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(b,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(_,0,2,0),v.add(_,8,5,8),v.add(_,6,0,6),v.add(_,11,0,11),v.add(_,13,13,13),v})();class w extends h.Disposable{constructor(x=o.VT500_TRANSITION_TABLE){super(),this._transitions=x,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(S,b,C)=>{},this._executeHandlerFb=S=>{},this._csiHandlerFb=(S,b)=>{},this._escHandlerFb=S=>{},this._errorHandlerFb=S=>S,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(x,S=[64,126]){let b=0;if(x.prefix){if(x.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=x.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(x.intermediates){if(x.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let O=0;O<x.intermediates.length;++O){const M=x.intermediates.charCodeAt(O);if(32>M||M>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=M}}if(x.final.length!==1)throw new Error("final must be a single byte");const C=x.final.charCodeAt(0);if(S[0]>C||C>S[1])throw new Error(`final must be in range ${S[0]} .. ${S[1]}`);return b<<=8,b|=C,b}identToString(x){const S=[];for(;x;)S.push(String.fromCharCode(255&x)),x>>=8;return S.reverse().join("")}setPrintHandler(x){this._printHandler=x}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(x,S){const b=this._identifier(x,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const C=this._escHandlers[b];return C.push(S),{dispose:()=>{const O=C.indexOf(S);O!==-1&&C.splice(O,1)}}}clearEscHandler(x){this._escHandlers[this._identifier(x,[48,126])]&&delete this._escHandlers[this._identifier(x,[48,126])]}setEscHandlerFallback(x){this._escHandlerFb=x}setExecuteHandler(x,S){this._executeHandlers[x.charCodeAt(0)]=S}clearExecuteHandler(x){this._executeHandlers[x.charCodeAt(0)]&&delete this._executeHandlers[x.charCodeAt(0)]}setExecuteHandlerFallback(x){this._executeHandlerFb=x}registerCsiHandler(x,S){const b=this._identifier(x);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const C=this._csiHandlers[b];return C.push(S),{dispose:()=>{const O=C.indexOf(S);O!==-1&&C.splice(O,1)}}}clearCsiHandler(x){this._csiHandlers[this._identifier(x)]&&delete this._csiHandlers[this._identifier(x)]}setCsiHandlerFallback(x){this._csiHandlerFb=x}registerDcsHandler(x,S){return this._dcsParser.registerHandler(this._identifier(x),S)}clearDcsHandler(x){this._dcsParser.clearHandler(this._identifier(x))}setDcsHandlerFallback(x){this._dcsParser.setHandlerFallback(x)}registerOscHandler(x,S){return this._oscParser.registerHandler(x,S)}clearOscHandler(x){this._oscParser.clearHandler(x)}setOscHandlerFallback(x){this._oscParser.setHandlerFallback(x)}setErrorHandler(x){this._errorHandler=x}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(x,S,b,C,O){this._parseStack.state=x,this._parseStack.handlers=S,this._parseStack.handlerPos=b,this._parseStack.transition=C,this._parseStack.chunkPos=O}parse(x,S,b){let C,O=0,M=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const N=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&B>-1){for(;B>=0&&(C=N[B](this._params),C!==!0);B--)if(C instanceof Promise)return this._parseStack.handlerPos=B,C}this._parseStack.handlers=[];break;case 4:if(b===!1&&B>-1){for(;B>=0&&(C=N[B](),C!==!0);B--)if(C instanceof Promise)return this._parseStack.handlerPos=B,C}this._parseStack.handlers=[];break;case 6:if(O=x[this._parseStack.chunkPos],C=this._dcsParser.unhook(O!==24&&O!==26,b),C)return C;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(O=x[this._parseStack.chunkPos],C=this._oscParser.end(O!==24&&O!==26,b),C)return C;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=D;N<S;++N){switch(O=x[N],M=this._transitions.table[this.currentState<<8|(O<160?O:_)],M>>4){case 2:for(let H=N+1;;++H){if(H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}if(++H>=S||(O=x[H])<32||O>126&&O<_){this._printHandler(x,N,H),N=H-1;break}}break;case 3:this._executeHandlers[O]?this._executeHandlers[O]():this._executeHandlerFb(O),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:N,code:O,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|O];let U=B?B.length-1:-1;for(;U>=0&&(C=B[U](this._params),C!==!0);U--)if(C instanceof Promise)return this._preserveStack(3,B,U,M,N),C;U<0&&this._csiHandlerFb(this._collect<<8|O,this._params),this.precedingJoinState=0;break;case 8:do switch(O){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(O-48)}while(++N<S&&(O=x[N])>47&&O<60);N--;break;case 9:this._collect<<=8,this._collect|=O;break;case 10:const Y=this._escHandlers[this._collect<<8|O];let K=Y?Y.length-1:-1;for(;K>=0&&(C=Y[K](),C!==!0);K--)if(C instanceof Promise)return this._preserveStack(4,Y,K,M,N),C;K<0&&this._escHandlerFb(this._collect<<8|O),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|O,this._params);break;case 13:for(let H=N+1;;++H)if(H>=S||(O=x[H])===24||O===26||O===27||O>127&&O<_){this._dcsParser.put(x,N,H),N=H-1;break}break;case 14:if(C=this._dcsParser.unhook(O!==24&&O!==26),C)return this._preserveStack(6,[],0,M,N),C;O===27&&(M|=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 H=N+1;;H++)if(H>=S||(O=x[H])<32||O>127&&O<_){this._oscParser.put(x,N,H),N=H-1;break}break;case 6:if(C=this._oscParser.end(O!==24&&O!==26),C)return this._preserveStack(5,[],0,M,N),C;O===27&&(M|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&M}}}o.EscapeSequenceParser=w},6242:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=u(5770),p=u(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const _=this._handlers[m];return _.push(g),{dispose:()=>{const w=_.indexOf(g);w!==-1&&_.splice(w,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,_){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(m,g,_);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(m,g,_))}start(){this.reset(),this._state=1}put(m,g,_){if(this._state!==3){if(this._state===1)for(;g<_;){const w=m[g++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&_-g>0&&this._put(m,g,_)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,w=this._active.length-1,v=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,_=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;w>=0&&(_=this._active[w].end(m),_!==!0);w--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,_;w--}for(;w>=0;w--)if(_=this._active[w].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",m);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,_){this._hitLimit||(this._data+=(0,p.utf32ToString)(m,g,_),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((_=>(this._data="",this._hitLimit=!1,_)));return this._data="",this._hitLimit=!1,g}}},8742:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const u=2147483647;class h{static fromArray(f){const m=new h;if(!f.length)return m;for(let g=Array.isArray(f[0])?1:0;g<f.length;++g){const _=f[g];if(Array.isArray(_))for(let w=0;w<_.length;++w)m.addSubParam(_[w]);else m.addParam(_)}return m}constructor(f=32,m=32){if(this.maxLength=f,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let m=0;m<this.length;++m){f.push(this.params[m]);const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&f.push(Array.prototype.slice.call(this._subParams,g,_))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const m=this._subParamsIdx[f]>>8,g=255&this._subParamsIdx[f];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&(f[m]=this._subParams.slice(g,_))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,_=g[m-1];g[m-1]=~_?Math.min(10*_+f,u):f}}o.Params=h},5741:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===u){h=p;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=u(3785),p=u(511);o.BufferApiView=class{constructor(f,m){this._buffer=f,this.type=m}init(f){return this._buffer=f,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(f){const m=this._buffer.lines.get(f);if(m)return new h.BufferLineApiView(m)}getNullCell(){return new p.CellData}}},3785:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=u(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new h.CellData)}translateToString(p,f,m){return this._line.translateToString(p,f,m)}}},8285:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=u(8771),p=u(8460),f=u(844);class m extends f.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(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)}}o.BufferNamespaceApi=m},7975:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(p=>h(p.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((p,f)=>h(p,f.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(l,o,u){var h=this&&this.__decorate||function(v,x,S,b){var C,O=arguments.length,M=O<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,x,S,b);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(M=(O<3?C(M):O>3?C(x,S,M):C(x,S))||M);return O>3&&M&&Object.defineProperty(x,S,M),M},p=this&&this.__param||function(v,x){return function(S,b){x(S,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=u(8460),m=u(844),g=u(5295),_=u(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(v,this))}resize(v,x){this.cols=v,this.rows=x,this.buffers.resize(v,x),this._onResize.fire({cols:v,rows:x})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,x=!1){const S=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===v.fg&&b.getBg(0)===v.bg||(b=S.getBlankLine(v,x),this._cachedBlankLine=b),b.isWrapped=x;const C=S.ybase+S.scrollTop,O=S.ybase+S.scrollBottom;if(S.scrollTop===0){const M=S.lines.isFull;O===S.lines.length-1?M?S.lines.recycle().copyFrom(b):S.lines.push(b.clone()):S.lines.splice(O+1,0,b.clone()),M?this.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this.isUserScrolling||S.ydisp++)}else{const M=O-C+1;S.lines.shiftElements(C+1,M-1,-1),S.lines.set(O,b.clone())}this.isUserScrolling||(S.ydisp=S.ybase),this._onScroll.fire(S.ydisp)}scrollLines(v,x,S){const b=this.buffer;if(v<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else v+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const C=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+v,b.ybase),0),C!==b.ydisp&&(x||this._onScroll.fire(b.ydisp))}};o.BufferService=w=h([p(0,_.IOptionsService)],w)},7994:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(l,o,u){var h=this&&this.__decorate||function(b,C,O,M){var D,N=arguments.length,B=N<3?C:M===null?M=Object.getOwnPropertyDescriptor(C,O):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,C,O,M);else for(var U=b.length-1;U>=0;U--)(D=b[U])&&(B=(N<3?D(B):N>3?D(C,O,B):D(C,O))||B);return N>3&&B&&Object.defineProperty(C,O,B),B},p=this&&this.__param||function(b,C){return function(O,M){C(O,M,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=u(2585),m=u(8460),g=u(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,C){let O=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(O|=64,O|=b.action):(O|=3&b.button,4&b.button&&(O|=64),8&b.button&&(O|=128),b.action===32?O|=32:b.action!==0||C||(O|=3)),O}const v=String.fromCharCode,x={DEFAULT:b=>{const C=[w(b,!1)+32,b.col+32,b.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:b=>{const C=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${C}`},SGR_PIXELS:b=>{const C=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${C}`}};let S=o.CoreMouseService=class extends g.Disposable{constructor(b,C){super(),this._bufferService=b,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const O of Object.keys(_))this.addProtocol(O,_[O]);for(const O of Object.keys(x))this.addEncoding(O,x[O]);this.reset()}addProtocol(b,C){this._protocols[b]=C}addEncoding(b,C){this._encodings[b]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const C=this._encodings[this._activeEncoding](b);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,C,O){if(O){if(b.x!==C.x||b.y!==C.y)return!1}else if(b.col!==C.col||b.row!==C.row)return!1;return b.button===C.button&&b.action===C.action&&b.ctrl===C.ctrl&&b.alt===C.alt&&b.shift===C.shift}};o.CoreMouseService=S=h([p(0,f.IBufferService),p(1,f.ICoreService)],S)},6975:function(l,o,u){var h=this&&this.__decorate||function(S,b,C,O){var M,D=arguments.length,N=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,C):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,b,C,O);else for(var B=S.length-1;B>=0;B--)(M=S[B])&&(N=(D<3?M(N):D>3?M(b,C,N):M(b,C))||N);return D>3&&N&&Object.defineProperty(b,C,N),N},p=this&&this.__param||function(S,b){return function(C,O){b(C,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=u(1439),m=u(8460),g=u(844),_=u(2585),w=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let x=o.CoreService=class extends g.Disposable{constructor(S,b,C){super(),this._bufferService=S,this._logService=b,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(v)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(v)}triggerDataEvent(S,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${S}"`,(()=>S.split("").map((O=>O.charCodeAt(0))))),this._onData.fire(S)}triggerBinaryEvent(S){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${S}"`,(()=>S.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(S))}};o.CoreService=x=h([p(0,_.IBufferService),p(1,_.ILogService),p(2,_.IOptionsService)],x)},9074:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=u(8055),p=u(8460),f=u(844),m=u(6106);let g=0,_=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((S=>S?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(S){if(S.marker.isDisposed)return;const b=new v(S);if(b){const C=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),C.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const S of this._decorations.values())S.dispose();this._decorations.clear()}*getDecorationsAtCell(S,b,C){let O=0,M=0;for(const D of this._decorations.getKeyIterator(b))O=D.options.x??0,M=O+(D.options.width??1),S>=O&&S<M&&(!C||(D.options.layer??"bottom")===C)&&(yield D)}forEachDecorationAtCell(S,b,C,O){this._decorations.forEachByKey(b,(M=>{g=M.options.x??0,_=g+(M.options.width??1),S>=g&&S<_&&(!C||(M.options.layer??"bottom")===C)&&O(M)}))}}o.DecorationService=w;class v extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(S){super(),this.options=S,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=S.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=u(2585),p=u(8343);class f{constructor(...g){this._entries=new Map;for(const[_,w]of g)this.set(_,w)}set(g,_){const w=this._entries.get(g);return this._entries.set(g,_),w}forEach(g){for(const[_,w]of this._entries.entries())g(_,w)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const _=(0,p.getServiceDependencies)(m).sort(((x,S)=>x.index-S.index)),w=[];for(const x of _){const S=this._services.get(x.id);if(!S)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${x.id}.`);w.push(S)}const v=_.length>0?_[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new m(...g,...w)}}},7866:function(l,o,u){var h=this&&this.__decorate||function(v,x,S,b){var C,O=arguments.length,M=O<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,x,S,b);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(M=(O<3?C(M):O>3?C(x,S,M):C(x,S))||M);return O>3&&M&&Object.defineProperty(x,S,M),M},p=this&&this.__param||function(v,x){return function(S,b){x(S,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=u(844),m=u(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let _,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),_=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let x=0;x<v.length;x++)typeof v[x]=="function"&&(v[x]=v[x]())}_log(v,x,S){this._evalLazyOptionalParams(S),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+x,...S)}trace(v,...x){this._logLevel<=m.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,v,x)}debug(v,...x){this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,v,x)}info(v,...x){this._logLevel<=m.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,v,x)}warn(v,...x){this._logLevel<=m.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,v,x)}error(v,...x){this._logLevel<=m.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,v,x)}};o.LogService=w=h([p(0,m.IOptionsService)],w),o.setTraceLogger=function(v){_=v},o.traceCall=function(v,x,S){if(typeof S.value!="function")throw new Error("not supported");const b=S.value;S.value=function(...C){if(_.logLevel!==m.LogLevelEnum.TRACE)return b.apply(this,C);_.trace(`GlyphRenderer#${b.name}(${C.map((M=>JSON.stringify(M))).join(", ")})`);const O=b.apply(this,C);return _.trace(`GlyphRenderer#${b.name} return`,O),O}}},7302:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=u(8460),p=u(844),f=u(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const x in w)if(x in v)try{const S=w[x];v[x]=this._sanitizeAndValidateOption(x,S)}catch(S){console.error(S)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,v){return this.onOptionChange((x=>{x===w&&v(this.rawOptions[w])}))}onMultipleOptionChange(w,v){return this.onOptionChange((x=>{w.indexOf(x)!==-1&&v()}))}_setupOptions(){const w=x=>{if(!(x in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);return this.rawOptions[x]},v=(x,S)=>{if(!(x in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);S=this._sanitizeAndValidateOption(x,S),this.rawOptions[x]!==S&&(this.rawOptions[x]=S,this._onOptionChange.fire(x))};for(const x in this.rawOptions){const S={get:w.bind(this,x),set:v.bind(this,x)};Object.defineProperty(this.options,x,S)}}_sanitizeAndValidateOption(w,v){switch(w){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[w]),!(function(x){return x==="block"||x==="underline"||x==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${w}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=m.includes(v)?v:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${w} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${w} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(l,o,u){var h=this&&this.__decorate||function(g,_,w,v){var x,S=arguments.length,b=S<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,w):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(g,_,w,v);else for(var C=g.length-1;C>=0;C--)(x=g[C])&&(b=(S<3?x(b):S>3?x(_,w,b):x(_,w))||b);return S>3&&b&&Object.defineProperty(_,w,b),b},p=this&&this.__param||function(g,_){return function(w,v){_(w,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=u(2585);let m=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const _=this._bufferService.buffer;if(g.id===void 0){const C=_.addMarker(_.ybase+_.y),O={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(O,C))),this._dataByLinkId.set(O.id,O),O.id}const w=g,v=this._getEntryIdKey(w),x=this._entriesWithId.get(v);if(x)return this.addLineToLink(x.id,_.ybase+_.y),x.id;const S=_.addMarker(_.ybase+_.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(b,S))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(g,_){const w=this._dataByLinkId.get(g);if(w&&w.lines.every((v=>v.line!==_))){const v=this._bufferService.buffer.addMarker(_);w.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(w,v)))}}getLinkData(g){return this._dataByLinkId.get(g)?.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,_){const w=g.lines.indexOf(_);w!==-1&&(g.lines.splice(w,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=m=h([p(0,f.IBufferService)],m)},8343:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const u="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const f=function(m,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,v,x){v[u]===v?v[h].push({id:w,index:x}):(v[h]=[{id:w,index:x}],v[u]=v)})(f,m,_)};return f.toString=()=>p,o.serviceRegistry.set(p,f),f}},2585:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=u(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(l,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=u(8460),p=u(225);class f{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,_,w=!1){return(16777215&g)<<3|(3&_)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const g=new p.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let _=0,w=0;const v=g.length;for(let x=0;x<v;++x){let S=g.charCodeAt(x);if(55296<=S&&S<=56319){if(++x>=v)return _+this.wcwidth(S);const O=g.charCodeAt(x);56320<=O&&O<=57343?S=1024*(S-55296)+O-56320+65536:_+=this.wcwidth(O)}const b=this.charProperties(S,w);let C=f.extractWidth(b);f.extractShouldJoin(b)&&(C-=f.extractWidth(w)),_+=C,w=b}return _}charProperties(g,_){return this._activeProvider.charProperties(g,_)}}o.UnicodeService=f}},i={};function r(l){var o=i[l];if(o!==void 0)return o.exports;var u=i[l]={exports:{}};return t[l].call(u.exports,u,u.exports,r),u.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const o=r(9042),u=r(3236),h=r(844),p=r(5741),f=r(8285),m=r(7975),g=r(7090),_=["cols","rows"];class w extends h.Disposable{constructor(x){super(),this._core=this.register(new u.Terminal(x)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const S=C=>this._core.options[C],b=(C,O)=>{this._checkReadonlyOptions(C),this._core.options[C]=O};for(const C in this._core.options){const O={get:S.bind(this,C),set:b.bind(this,C)};Object.defineProperty(this._publicOptions,C,O)}}_checkReadonlyOptions(x){if(_.includes(x))throw new Error(`Option "${x}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const x=this._core.coreService.decPrivateModes;let S="none";switch(this._core.coreMouseService.activeProtocol){case"X10":S="x10";break;case"VT200":S="vt200";break;case"DRAG":S="drag";break;case"ANY":S="any"}return{applicationCursorKeysMode:x.applicationCursorKeys,applicationKeypadMode:x.applicationKeypad,bracketedPasteMode:x.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:S,originMode:x.origin,reverseWraparoundMode:x.reverseWraparound,sendFocusMode:x.sendFocus,wraparoundMode:x.wraparound}}get options(){return this._publicOptions}set options(x){for(const S in x)this._publicOptions[S]=x[S]}blur(){this._core.blur()}focus(){this._core.focus()}input(x,S=!0){this._core.input(x,S)}resize(x,S){this._verifyIntegers(x,S),this._core.resize(x,S)}open(x){this._core.open(x)}attachCustomKeyEventHandler(x){this._core.attachCustomKeyEventHandler(x)}attachCustomWheelEventHandler(x){this._core.attachCustomWheelEventHandler(x)}registerLinkProvider(x){return this._core.registerLinkProvider(x)}registerCharacterJoiner(x){return this._checkProposedApi(),this._core.registerCharacterJoiner(x)}deregisterCharacterJoiner(x){this._checkProposedApi(),this._core.deregisterCharacterJoiner(x)}registerMarker(x=0){return this._verifyIntegers(x),this._core.registerMarker(x)}registerDecoration(x){return this._checkProposedApi(),this._verifyPositiveIntegers(x.x??0,x.width??0,x.height??0),this._core.registerDecoration(x)}hasSelection(){return this._core.hasSelection()}select(x,S,b){this._verifyIntegers(x,S,b),this._core.select(x,S,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(x,S){this._verifyIntegers(x,S),this._core.selectLines(x,S)}dispose(){super.dispose()}scrollLines(x){this._verifyIntegers(x),this._core.scrollLines(x)}scrollPages(x){this._verifyIntegers(x),this._core.scrollPages(x)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(x){this._verifyIntegers(x),this._core.scrollToLine(x)}clear(){this._core.clear()}write(x,S){this._core.write(x,S)}writeln(x,S){this._core.write(x),this._core.write(`\r
120
+ `,S)}paste(x){this._core.paste(x)}refresh(x,S){this._verifyIntegers(x,S),this._core.refresh(x,S)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(x){this._addonManager.loadAddon(this,x)}static get strings(){return o}_verifyIntegers(...x){for(const S of x)if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...x){for(const S of x)if(S&&(S===1/0||isNaN(S)||S%1!=0||S<0))throw new Error("This API only accepts positive integers")}}l.Terminal=w})(),a})()))})(j_)),j_.exports}var OV=RV();var NV=2,DV=1,IV=class{activate(n){this._terminal=n}dispose(){}fit(){let n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;let e=this._terminal._core;(this._terminal.rows!==n.rows||this._terminal.cols!==n.cols)&&(e._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let n=this._terminal._core._renderService.dimensions;if(n.css.cell.width===0||n.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,t=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(t.getPropertyValue("height")),r=Math.max(0,parseInt(t.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),l={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},o=l.top+l.bottom,u=l.right+l.left,h=i-o,p=r-u-e;return{cols:Math.max(NV,Math.floor(p/n.css.cell.width)),rows:Math.max(DV,Math.floor(h/n.css.cell.height))}}};var U_=[[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]],LV=[[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]],Ei;function BV(n,e){let t=0,i=e.length-1,r;if(n<e[0][0]||n>e[i][1])return!1;for(;i>=t;)if(r=t+i>>1,n>e[r][1])t=r+1;else if(n<e[r][0])i=r-1;else return!0;return!1}var zV=class{constructor(){if(this.version="6",!Ei){Ei=new Uint8Array(65536),Ei.fill(1),Ei[0]=0,Ei.fill(0,1,32),Ei.fill(0,127,160),Ei.fill(2,4352,4448),Ei[9001]=2,Ei[9002]=2,Ei.fill(2,11904,42192),Ei[12351]=1,Ei.fill(2,44032,55204),Ei.fill(2,63744,64256),Ei.fill(2,65040,65050),Ei.fill(2,65072,65136),Ei.fill(2,65280,65377),Ei.fill(2,65504,65511);for(let n=0;n<U_.length;++n)Ei.fill(0,U_[n][0],U_[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?Ei[n]:BV(n,LV)?0:n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}charProperties(n,e){let t=this.wcwidth(n),i=t===0&&e!==0;if(i){let r=sm.extractWidth(e);r===0?i=!1:r>t&&(t=r)}return sm.createPropertyValue(0,t,i)}},PV=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(n){setTimeout(()=>{throw n.stack?lE.isErrorNoTelemetry(n)?new lE(n.message+`
121
+
122
+ `+n.stack):new Error(n.message+`
123
+
124
+ `+n.stack):n},0)}}addListener(n){return this.listeners.push(n),()=>{this._removeListener(n)}}emit(n){this.listeners.forEach(e=>{e(n)})}_removeListener(n){this.listeners.splice(this.listeners.indexOf(n),1)}setUnexpectedErrorHandler(n){this.unexpectedErrorHandler=n}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(n){this.unexpectedErrorHandler(n),this.emit(n)}onUnexpectedExternalError(n){this.unexpectedErrorHandler(n)}},FV=new PV;function H_(n){jV(n)||FV.onUnexpectedError(n)}var M0="Canceled";function jV(n){return n instanceof UV?!0:n instanceof Error&&n.name===M0&&n.message===M0}var UV=class extends Error{constructor(){super(M0),this.name=this.message}},lE=class R0 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof R0)return e;let t=new R0;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function HV(n,e){let t=this,i=!1,r;return function(){return i||(i=!0,e||(r=n.apply(t,arguments))),r}}var qV;(n=>{function e(a){return a<0}n.isLessThan=e;function t(a){return a<=0}n.isLessThanOrEqual=t;function i(a){return a>0}n.isGreaterThan=i;function r(a){return a===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(qV||={});var cA;(n=>{function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}n.is=e;let t=Object.freeze([]);function i(){return t}n.empty=i;function*r(C){yield C}n.single=r;function a(C){return e(C)?C:r(C)}n.wrap=a;function l(C){return C||t}n.from=l;function*o(C){for(let O=C.length-1;O>=0;O--)yield C[O]}n.reverse=o;function u(C){return!C||C[Symbol.iterator]().next().done===!0}n.isEmpty=u;function h(C){return C[Symbol.iterator]().next().value}n.first=h;function p(C,O){let M=0;for(let D of C)if(O(D,M++))return!0;return!1}n.some=p;function f(C,O){for(let M of C)if(O(M))return M}n.find=f;function*m(C,O){for(let M of C)O(M)&&(yield M)}n.filter=m;function*g(C,O){let M=0;for(let D of C)yield O(D,M++)}n.map=g;function*_(C,O){let M=0;for(let D of C)yield*O(D,M++)}n.flatMap=_;function*w(...C){for(let O of C)yield*O}n.concat=w;function v(C,O,M){let D=M;for(let N of C)D=O(D,N);return D}n.reduce=v;function*x(C,O,M=C.length){for(O<0&&(O+=C.length),M<0?M+=C.length:M>C.length&&(M=C.length);O<M;O++)yield C[O]}n.slice=x;function S(C,O=Number.POSITIVE_INFINITY){let M=[];if(O===0)return[M,C];let D=C[Symbol.iterator]();for(let N=0;N<O;N++){let B=D.next();if(B.done)return[M,n.empty()];M.push(B.value)}return[M,{[Symbol.iterator](){return D}}]}n.consume=S;async function b(C){let O=[];for await(let M of C)O.push(M);return Promise.resolve(O)}n.asyncToArray=b})(cA||={});function uA(n){if(cA.is(n)){let e=[];for(let t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function VV(...n){return hA(()=>uA(n))}function hA(n){return{dispose:HV(()=>{n()})}}var dA=class fA{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{uA(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?fA.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};dA.DISABLE_DISPOSED_WARNING=!1;var Xb=dA,rm=class{constructor(){this._store=new Xb,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)}};rm.None=Object.freeze({dispose(){}});var WV=globalThis.performance&&typeof globalThis.performance.now=="function",$V=class pA{static create(e){return new pA(e)}constructor(e){this._now=WV&&e===!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}},GV;(n=>{n.None=()=>rm.None;function e(K,H){return f(K,()=>{},0,void 0,!0,void 0,H)}n.defer=e;function t(K){return(H,J=null,Q)=>{let Z=!1,ie;return ie=K(ne=>{if(!Z)return ie?ie.dispose():Z=!0,H.call(J,ne)},null,Q),Z&&ie.dispose(),ie}}n.once=t;function i(K,H,J){return h((Q,Z=null,ie)=>K(ne=>Q.call(Z,H(ne)),null,ie),J)}n.map=i;function r(K,H,J){return h((Q,Z=null,ie)=>K(ne=>{H(ne),Q.call(Z,ne)},null,ie),J)}n.forEach=r;function a(K,H,J){return h((Q,Z=null,ie)=>K(ne=>H(ne)&&Q.call(Z,ne),null,ie),J)}n.filter=a;function l(K){return K}n.signal=l;function o(...K){return(H,J=null,Q)=>{let Z=VV(...K.map(ie=>ie(ne=>H.call(J,ne))));return p(Z,Q)}}n.any=o;function u(K,H,J,Q){let Z=J;return i(K,ie=>(Z=H(Z,ie),Z),Q)}n.reduce=u;function h(K,H){let J,Q={onWillAddFirstListener(){J=K(Z.fire,Z)},onDidRemoveLastListener(){J?.dispose()}},Z=new Io(Q);return H?.add(Z),Z.event}function p(K,H){return H instanceof Array?H.push(K):H&&H.add(K),K}function f(K,H,J=100,Q=!1,Z=!1,ie,ne){let P,L,F,$=0,W,ye={leakWarningThreshold:ie,onWillAddFirstListener(){P=K(Ne=>{$++,L=H(L,Ne),Q&&!F&&(be.fire(L),L=void 0),W=()=>{let le=L;L=void 0,F=void 0,(!Q||$>1)&&be.fire(le),$=0},typeof J=="number"?(clearTimeout(F),F=setTimeout(W,J)):F===void 0&&(F=0,queueMicrotask(W))})},onWillRemoveListener(){Z&&$>0&&W?.()},onDidRemoveLastListener(){W=void 0,P.dispose()}},be=new Io(ye);return ne?.add(be),be.event}n.debounce=f;function m(K,H=0,J){return n.debounce(K,(Q,Z)=>Q?(Q.push(Z),Q):[Z],H,void 0,!0,void 0,J)}n.accumulate=m;function g(K,H=(Q,Z)=>Q===Z,J){let Q=!0,Z;return a(K,ie=>{let ne=Q||!H(ie,Z);return Q=!1,Z=ie,ne},J)}n.latch=g;function _(K,H,J){return[n.filter(K,H,J),n.filter(K,Q=>!H(Q),J)]}n.split=_;function w(K,H=!1,J=[],Q){let Z=J.slice(),ie=K(L=>{Z?Z.push(L):P.fire(L)});Q&&Q.add(ie);let ne=()=>{Z?.forEach(L=>P.fire(L)),Z=null},P=new Io({onWillAddFirstListener(){ie||(ie=K(L=>P.fire(L)),Q&&Q.add(ie))},onDidAddFirstListener(){Z&&(H?setTimeout(ne):ne())},onDidRemoveLastListener(){ie&&ie.dispose(),ie=null}});return Q&&Q.add(P),P.event}n.buffer=w;function v(K,H){return(J,Q,Z)=>{let ie=H(new S);return K(function(ne){let P=ie.evaluate(ne);P!==x&&J.call(Q,P)},void 0,Z)}}n.chain=v;let x=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(H){return this.steps.push(H),this}forEach(H){return this.steps.push(J=>(H(J),J)),this}filter(H){return this.steps.push(J=>H(J)?J:x),this}reduce(H,J){let Q=J;return this.steps.push(Z=>(Q=H(Q,Z),Q)),this}latch(H=(J,Q)=>J===Q){let J=!0,Q;return this.steps.push(Z=>{let ie=J||!H(Z,Q);return J=!1,Q=Z,ie?Z:x}),this}evaluate(H){for(let J of this.steps)if(H=J(H),H===x)break;return H}}function b(K,H,J=Q=>Q){let Q=(...P)=>ne.fire(J(...P)),Z=()=>K.on(H,Q),ie=()=>K.removeListener(H,Q),ne=new Io({onWillAddFirstListener:Z,onDidRemoveLastListener:ie});return ne.event}n.fromNodeEventEmitter=b;function C(K,H,J=Q=>Q){let Q=(...P)=>ne.fire(J(...P)),Z=()=>K.addEventListener(H,Q),ie=()=>K.removeEventListener(H,Q),ne=new Io({onWillAddFirstListener:Z,onDidRemoveLastListener:ie});return ne.event}n.fromDOMEventEmitter=C;function O(K){return new Promise(H=>t(K)(H))}n.toPromise=O;function M(K){let H=new Io;return K.then(J=>{H.fire(J)},()=>{H.fire(void 0)}).finally(()=>{H.dispose()}),H.event}n.fromPromise=M;function D(K,H){return K(J=>H.fire(J))}n.forward=D;function N(K,H,J){return H(J),K(Q=>H(Q))}n.runAndSubscribe=N;class B{constructor(H,J){this._observable=H,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:()=>{H.addObserver(this)},onDidRemoveLastListener:()=>{H.removeObserver(this)}};this.emitter=new Io(Q),J&&J.add(this.emitter)}beginUpdate(H){this._counter++}handlePossibleChange(H){}handleChange(H,J){this._hasChanged=!0}endUpdate(H){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(K,H){return new B(K,H).emitter.event}n.fromObservable=U;function Y(K){return(H,J,Q)=>{let Z=0,ie=!1,ne={beginUpdate(){Z++},endUpdate(){Z--,Z===0&&(K.reportChanges(),ie&&(ie=!1,H.call(J)))},handlePossibleChange(){},handleChange(){ie=!0}};K.addObserver(ne),K.reportChanges();let P={dispose(){K.removeObserver(ne)}};return Q instanceof Xb?Q.add(P):Array.isArray(Q)&&Q.push(P),P}}n.fromObservableLight=Y})(GV||={});var O0=class N0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${N0._idPool++}`,N0.all.add(this)}start(e){this._stopWatch=new $V,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};O0.all=new Set,O0._idPool=0;var KV=O0,YV=-1,mA=class gA{constructor(e,t,i=(gA._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[a,l]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${l}):`;console.warn(o),console.warn(a);let u=new JV(o,a);this._errorHandler(u)}return()=>{let a=this._stacks.get(e.value)||0;this._stacks.set(e.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[i,r]of this._stacks)(!e||t<r)&&(e=[i,r],t=r);return e}};mA._idPool=1;var XV=mA,ZV=class yA{constructor(e){this.value=e}static create(){let e=new Error;return new yA(e.stack??"")}print(){console.warn(this.value.split(`
125
+ `).slice(2).join(`
126
+ `))}},JV=class extends Error{constructor(n,e){super(n),this.name="ListenerLeakError",this.stack=e}},QV=class extends Error{constructor(n,e){super(n),this.name="ListenerRefusalError",this.stack=e}},eW=0,q_=class{constructor(n){this.value=n,this.id=eW++}},tW=2,nW,Io=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new XV(n?.onListenerError??H_,this._options?.leakWarningThreshold??YV):void 0,this._perfMon=this._options?._profName?new KV(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(n,e,t)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new QV(`${l}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||H_)(u),rm.None}if(this._disposed)return rm.None;e&&(n=n.bind(e));let i=new q_(n),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=ZV.create(),r=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof q_?(this._deliveryQueue??=new iW,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=hA(()=>{r?.(),this._removeListener(i)});return t instanceof Xb?t.add(a):Array.isArray(t)&&t.push(a),a},this._event}_removeListener(n){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,t=e.indexOf(n);if(t===-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--,e[t]=void 0;let i=this._deliveryQueue.current===this;if(this._size*tW<=e.length){let r=0;for(let a=0;a<e.length;a++)e[a]?e[r++]=e[a]:i&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(n,e){if(!n)return;let t=this._options?.onListenerError||H_;if(!t){n.value(e);return}try{n.value(e)}catch(i){t(i)}}_deliverQueue(n){let e=n.current._listeners;for(;n.i<n.end;)this._deliver(e[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof q_)this._deliver(this._listeners,n);else{let e=this._deliveryQueue;e.enqueue(this,n,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},iW=class{constructor(){this.i=-1,this.end=0}enqueue(n,e,t){this.i=0,this.end=t,this.current=n,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},sm=class Dp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Io,this.onChange=this._onChange.event;let e=new zV;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,i=!1){return(e&16777215)<<3|(t&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,i=0,r=e.length;for(let a=0;a<r;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=r)return t+this.wcwidth(l);let h=e.charCodeAt(a);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:t+=this.wcwidth(h)}let o=this.charProperties(l,i),u=Dp.extractWidth(o);Dp.extractShouldJoin(o)&&(u-=Dp.extractWidth(i)),t+=u,i=o}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},V_=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],rW=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],W_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],sW=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Ia;function cE(n,e){let t=0,i=e.length-1,r;if(n<e[0][0]||n>e[i][1])return!1;for(;i>=t;)if(r=t+i>>1,n>e[r][1])t=r+1;else if(n<e[r][0])i=r-1;else return!0;return!1}var aW=class{constructor(){if(this.version="11",!Ia){Ia=new Uint8Array(65536),Ia.fill(1),Ia[0]=0,Ia.fill(0,1,32),Ia.fill(0,127,160);for(let n=0;n<V_.length;++n)Ia.fill(0,V_[n][0],V_[n][1]+1);for(let n=0;n<W_.length;++n)Ia.fill(2,W_[n][0],W_[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?Ia[n]:cE(n,rW)?0:cE(n,sW)?2:1}charProperties(n,e){let t=this.wcwidth(n),i=t===0&&e!==0;if(i){let r=sm.extractWidth(e);r===0?i=!1:r>t&&(t=r)}return sm.createPropertyValue(0,t,i)}},oW=class{activate(n){n.unicode.register(new aW)}dispose(){}};var lW=class{constructor(n,e,t,i={}){this._terminal=n,this._regex=e,this._handler=t,this._options=i}provideLinks(n,e){let t=uW.computeLink(n,this._regex,this._terminal,this._handler);e(this._addCallbacks(t))}_addCallbacks(n){return n.map(e=>(e.leave=this._options.leave,e.hover=(t,i)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,i,r)}},e))}};function cW(n){try{let e=new URL(n),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return n.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}var uW=class Ip{static computeLink(e,t,i,r){let a=new RegExp(t.source,(t.flags||"")+"g"),[l,o]=Ip._getWindowedLineStrings(e-1,i),u=l.join(""),h,p=[];for(;h=a.exec(u);){let f=h[0];if(!cW(f))continue;let[m,g]=Ip._mapStrIdx(i,o,0,h.index),[_,w]=Ip._mapStrIdx(i,m,g,f.length);if(m===-1||g===-1||_===-1||w===-1)continue;let v={start:{x:g+1,y:m+1},end:{x:w,y:_+1}};p.push({range:v,text:f,activate:r})}return p}static _getWindowedLineStrings(e,t){let i,r=e,a=e,l=0,o="",u=[];if(i=t.buffer.active.getLine(e)){let h=i.translateToString(!0);if(i.isWrapped&&h[0]!==" "){for(l=0;(i=t.buffer.active.getLine(--r))&&l<2048&&(o=i.translateToString(!0),l+=o.length,u.push(o),!(!i.isWrapped||o.indexOf(" ")!==-1)););u.reverse()}for(u.push(h),l=0;(i=t.buffer.active.getLine(++a))&&i.isWrapped&&l<2048&&(o=i.translateToString(!0),l+=o.length,u.push(o),o.indexOf(" ")===-1););}return[u,r]}static _mapStrIdx(e,t,i,r){let a=e.buffer.active,l=a.getNullCell(),o=i;for(;r;){let u=a.getLine(t);if(!u)return[-1,-1];for(let h=o;h<u.length;++h){u.getCell(h,l);let p=l.getChars();if(l.getWidth()&&(r-=p.length||1,h===u.length-1&&p==="")){let f=a.getLine(t+1);f&&f.isWrapped&&(f.getCell(0,l),l.getWidth()===2&&(r+=1))}if(r<0)return[t,h]}t++,o=0}return[t,o]}},hW=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function dW(n,e){let t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var fW=class{constructor(n=dW,e={}){this._handler=n,this._options=e}activate(n){this._terminal=n;let e=this._options,t=e.urlRegex||hW;this._linkProvider=this._terminal.registerLinkProvider(new lW(this._terminal,t,this._handler,e))}dispose(){this._linkProvider?.dispose()}};const Ni={default:{background:"#0a0a1a",foreground:"#e0e0e0",cursor:"#e0e0e0",cursorAccent:"#0a0a1a",selectionBackground:"rgba(0,229,255,0.3)",selectionForeground:"#ffffff",black:"#0a0a1a",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#00e5ff",white:"#e0e0e0",brightBlack:"#555555",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"},dark:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"rgba(255,255,255,0.15)",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"},monokai:{background:"#272822",foreground:"#f8f8f2",cursor:"#f8f8f2",cursorAccent:"#272822",selectionBackground:"rgba(73,72,62,0.6)",selectionForeground:"#ffffff",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"},dracula:{background:"#282a36",foreground:"#f8f8f2",cursor:"#f8f8f2",cursorAccent:"#282a36",selectionBackground:"rgba(68,71,90,0.6)",selectionForeground:"#ffffff",black:"#21222c",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"},"solarized-dark":{background:"#002b36",foreground:"#839496",cursor:"#839496",cursorAccent:"#002b36",selectionBackground:"rgba(7,54,66,0.6)",selectionForeground:"#93a1a1",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#586e75",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"},nord:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",cursorAccent:"#2e3440",selectionBackground:"rgba(67,76,94,0.6)",selectionForeground:"#eceff4",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"},"github-dark":{background:"#0d1117",foreground:"#c9d1d9",cursor:"#c9d1d9",cursorAccent:"#0d1117",selectionBackground:"rgba(56,139,253,0.25)",selectionForeground:"#ffffff",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"}};function pW(){const n=getComputedStyle(document.body),e=r=>n.getPropertyValue(r).trim(),t=e("--bg-primary")||Ni.default.background,i=e("--text-primary")||Ni.default.foreground;return{background:t,foreground:i,cursor:i,cursorAccent:t,selectionBackground:"rgba(255,255,255,0.18)",selectionForeground:"#ffffff",black:t,red:e("--accent-red")||Ni.default.red,green:e("--accent-green")||Ni.default.green,yellow:e("--accent-orange")||Ni.default.yellow,blue:e("--accent-cyan")||Ni.default.blue,magenta:e("--accent-purple")||Ni.default.magenta,cyan:e("--accent-cyan")||Ni.default.cyan,white:i,brightBlack:e("--text-dim")||Ni.default.brightBlack,brightRed:e("--accent-red")||Ni.default.brightRed,brightGreen:e("--accent-green")||Ni.default.brightGreen,brightYellow:e("--accent-orange")||Ni.default.brightYellow,brightBlue:e("--accent-cyan")||Ni.default.brightBlue,brightMagenta:e("--accent-purple")||Ni.default.brightMagenta,brightCyan:e("--accent-cyan")||Ni.default.brightCyan,brightWhite:"#ffffff"}}function mW(){return Object.keys(Ni)}function $_(n){return n==="auto"?pW():Ni[n]||Ni.default}function gW(n){const e=n.buffer.active;return e.viewportY>=e.baseY}function yW(){const n=window.innerWidth;return n<=480?11:n<=640?12:14}function Xc(n,e,t,i){n&&n.readyState===1&&t>0&&i>0&&n.send(JSON.stringify({type:"terminal_resize",terminalId:e,cols:t,rows:i}))}function uE(n,e,t,i,r){requestAnimationFrame(()=>{!r.current||r.current.terminalId!==e||(i.fit(),Xc(n,e,t.cols,t.rows),t.refresh(0,t.rows-1),r.current&&(r.current.layoutReady=!0))})}function _W({ws:n,themeName:e="auto"}){const t=V.useRef(null),i=V.useRef(null),r=V.useRef(new Map),a=V.useRef(new Map),l=V.useRef(e),o=V.useRef(n),u=V.useRef(null),h=V.useRef(null),[p,f]=V.useState(!1),[m,g]=V.useState(null),[_,w]=V.useState(!1);V.useEffect(()=>{l.current=e},[e]),V.useEffect(()=>{if(o.current=n,i.current&&n&&n.readyState===1){const{terminalId:ne}=i.current;u.current&&u.current!==ne&&n.send(JSON.stringify({type:"terminal_disconnect",terminalId:u.current})),n.send(JSON.stringify({type:"terminal_subscribe",terminalId:ne})),u.current=ne}},[n]);const v=V.useCallback(()=>{if(h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i.current){const{terminalId:ne}=i.current;r.current.delete(`__active__${ne}`),i.current.resizeObserver.disconnect(),i.current.term.dispose(),i.current=null}t.current&&(t.current.innerHTML=""),f(!1),g(null),w(!1),document.body.classList.remove("terminal-focused")},[]),x=V.useCallback(ne=>{v();const P=t.current;if(!P)return;const L=P;L.innerHTML="";const F=(()=>{try{return localStorage.getItem("terminal-theme")||"auto"}catch{return"auto"}})();l.current=F;const $=$_(F);L.style.background=$.background||"",r.current.delete(ne),a.current.delete(ne),o.current&&o.current.readyState===1&&(u.current&&u.current!==ne&&o.current.send(JSON.stringify({type:"terminal_disconnect",terminalId:u.current})),o.current.send(JSON.stringify({type:"terminal_subscribe",terminalId:ne})),u.current=ne);function W(be){L.offsetWidth>0&&L.offsetHeight>0?ye():be>0&&requestAnimationFrame(()=>setTimeout(()=>W(be-1),50))}function ye(){const be=new OV.Terminal({cursorBlink:!1,cursorStyle:"bar",fontSize:yW(),fontFamily:"'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Menlo', monospace",fontWeight:"400",fontWeightBold:"700",lineHeight:1.15,letterSpacing:0,theme:$_(l.current),allowProposedApi:!0,scrollback:5e3,convertEol:!1,drawBoldTextInBrightColors:!0,minimumContrastRatio:1}),Ne=new IV;be.loadAddon(Ne);try{const Ce=new oW;be.loadAddon(Ce),be.unicode.activeVersion="11"}catch{}try{const Ce=new fW;be.loadAddon(Ce)}catch{}be.open(L),be.attachCustomKeyEventHandler(Ce=>Ce.key==="Escape"?(Ce.preventDefault(),Ce.type==="keydown"&&o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:ne,data:"\x1B"})),!1):!0),Ne.fit(),Xc(o.current,ne,be.cols,be.rows),be.onData(Ce=>{o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:ne,data:Ce}))}),be.onBinary(Ce=>{o.current&&o.current.readyState===1&&o.current.send(JSON.stringify({type:"terminal_input",terminalId:ne,data:Ce}))});let le=null;const ee=new ResizeObserver(()=>{le&&clearTimeout(le),le=setTimeout(()=>{Ne.fit(),Xc(o.current,ne,be.cols,be.rows)},200)});ee.observe(L),i.current={terminalId:ne,term:be,fitAddon:Ne,resizeObserver:ee,layoutReady:!1},f(!0),g(ne),be.focus(),document.body.classList.add("terminal-focused"),uE(o.current,ne,be,Ne,i),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!i.current||i.current.terminalId!==ne)return;const Ce=r.current.get(ne);if(Ce&&Ce.length>0){for(const xe of Ce){const Ze=Uint8Array.from(atob(xe),De=>De.charCodeAt(0));be.write(Ze)}r.current.delete(ne),a.current.delete(ne)}})})}W(60)},[v]),S=V.useCallback((ne,P)=>{if(i.current&&i.current.terminalId===ne){const L=r.current.get(`__active__${ne}`)||[];L.push(P),r.current.set(`__active__${ne}`,L),h.current===null&&(h.current=requestAnimationFrame(()=>{if(h.current=null,!i.current)return;const F=i.current.terminalId,$=r.current.get(`__active__${F}`);if(!$||$.length===0)return;r.current.delete(`__active__${F}`);const{term:W}=i.current,ye=gW(W);for(const be of $){const Ne=Uint8Array.from(atob(be),le=>le.charCodeAt(0));W.write(Ne)}ye&&W.scrollToBottom()}))}else{const L=Date.now();a.current.set(ne,L);for(const[$,W]of a.current)L-W>6e4&&(r.current.delete($),a.current.delete($));const F=r.current.get(ne)||[];F.push(P),F.length>500&&F.shift(),r.current.set(ne,F)}},[]),b=V.useCallback(ne=>{i.current&&i.current.terminalId===ne&&requestAnimationFrame(()=>{if(!i.current||!i.current.fitAddon)return;const P=i.current.term.cols,L=i.current.term.rows;i.current.fitAddon.fit();const F=i.current.term.cols,$=i.current.term.rows;(F!==P||$!==L)&&Xc(o.current,ne,F,$)})},[]),C=V.useCallback((ne,P)=>{i.current&&i.current.terminalId===ne&&i.current.term.write(`\r
127
+ \x1B[31m--- Terminal ${P||"closed"} ---\x1B[0m\r
128
+ `)},[]),O=V.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B"})),i.current.term.focus())},[]),M=V.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B[A"})),i.current.term.focus())},[]),D=V.useCallback(()=>{!i.current||!o.current||o.current.readyState!==1||(o.current.send(JSON.stringify({type:"terminal_input",terminalId:i.current.terminalId,data:"\x1B[B"})),i.current.term.focus())},[]),N=V.useCallback(async()=>{if(!i.current||!o.current||o.current.readyState!==1)return;const{terminalId:ne}=i.current;let P=null;if(navigator.clipboard?.readText)try{P=await navigator.clipboard.readText()}catch{}if(!P)try{const L=document.createElement("textarea");L.style.position="fixed",L.style.left="-9999px",L.style.opacity="0",document.body.appendChild(L),L.focus(),document.execCommand("paste"),P=L.value,document.body.removeChild(L)}catch{}P||(P=window.prompt("Paste text to send to terminal:")),P&&(o.current.send(JSON.stringify({type:"terminal_input",terminalId:ne,data:P})),i.current?.term.focus())},[]),B=V.useCallback(()=>{if(!i.current)return;const{terminalId:ne,term:P,fitAddon:L}=i.current;requestAnimationFrame(()=>{!i.current||i.current.terminalId!==ne||(L.fit(),Xc(o.current,ne,P.cols,P.rows),P.refresh(0,P.rows-1),P.scrollToBottom())})},[]),U=V.useCallback(()=>{w(ne=>!ne)},[]),Y=V.useCallback(ne=>{if(!i.current)return;const{terminalId:P,term:L,fitAddon:F,resizeObserver:$}=i.current,W=L.element;if(!W||W.parentElement===ne)return;ne.appendChild(W),$.disconnect();let ye=null;const be=new ResizeObserver(()=>{ye&&clearTimeout(ye),ye=setTimeout(()=>{i.current&&(i.current.fitAddon.fit(),Xc(o.current,i.current.terminalId,i.current.term.cols,i.current.term.rows))},200)});be.observe(ne),i.current.resizeObserver=be,requestAnimationFrame(()=>{!i.current||i.current.terminalId!==P||(uE(o.current,P,L,F,i),L.focus())})},[]),K=V.useCallback(()=>{i.current&&i.current.term.scrollToBottom()},[]),H=V.useCallback(()=>{i.current&&i.current.term.scrollPages(-1)},[]),J=V.useCallback(()=>{i.current&&i.current.term.scrollPages(1)},[]),Q=V.useCallback(()=>{if(!i.current)return null;const{term:ne}=i.current,P=ne.getSelection();return P?{scrollLine:ne.buffer.active.viewportY,selectedText:P}:null},[]),Z=V.useCallback(ne=>{i.current&&i.current.term.scrollToLine(ne)},[]),ie=V.useCallback(ne=>{l.current=ne;try{localStorage.setItem("terminal-theme",ne)}catch{}if(i.current){const P=$_(ne);i.current.term.options.theme=P}},[]);return V.useEffect(()=>()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i.current&&(i.current.resizeObserver.disconnect(),i.current.term.dispose(),i.current=null)},[]),V.useEffect(()=>{const ne=P=>{P.key==="F11"&&P.altKey&&i.current&&(P.preventDefault(),w(L=>!L))};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[]),{containerRef:t,attach:x,detach:v,isAttached:p,activeTerminalId:m,toggleFullscreen:U,isFullscreen:_,sendEscape:O,sendArrowUp:M,sendArrowDown:D,pasteToTerminal:N,refitTerminal:B,setTheme:ie,handleTerminalOutput:S,handleTerminalReady:b,handleTerminalClosed:C,reparent:Y,scrollToBottom:K,scrollPageUp:H,scrollPageDown:J,getTerminalBookmark:Q,scrollToLine:Z}}function bW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),A.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})}function vW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),A.jsx("polyline",{points:"5 12 12 5 19 12"})]})}function xW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),A.jsx("polyline",{points:"19 12 12 19 5 12"})]})}function SW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"15 3 21 3 21 9"}),A.jsx("polyline",{points:"9 21 3 21 3 15"}),A.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),A.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function wW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"4 14 10 14 10 20"}),A.jsx("polyline",{points:"20 10 14 10 14 4"}),A.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),A.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function CW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"16"}),A.jsx("polyline",{points:"5 10 12 17 19 10"}),A.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"})]})}function EW({active:n}){return A.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:n?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})}function kW(){return A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),A.jsx("text",{x:"12",y:"15",textAnchor:"middle",fill:"currentColor",stroke:"none",fontSize:"8",fontWeight:"700",fontFamily:"sans-serif",children:"ESC"})]})}function hE({themeName:n,onThemeChange:e,onFullscreen:t,onSendEscape:i,onSendArrowUp:r,onSendArrowDown:a,onPaste:l,onReconnect:o,onScrollToBottom:u,onBookmark:h,bookmarkCount:p=0,isFullscreen:f,showReconnect:m=!1}){const g=mW(),_=V.useCallback(w=>{e(w.target.value)},[e]);return A.jsxs("div",{className:gt.toolbar,children:[A.jsxs("select",{className:gt.themeSelect,value:n,onChange:_,title:"Terminal theme",children:[A.jsx("option",{value:"auto",children:"Auto"}),g.map(w=>A.jsx("option",{value:w,children:w.charAt(0).toUpperCase()+w.slice(1)},w))]}),A.jsx("button",{className:gt.toolbarBtn,onClick:i,title:"Send Escape key to terminal",children:A.jsx(kW,{})}),A.jsx("button",{className:gt.toolbarBtn,onClick:l,title:"Paste clipboard to terminal",children:A.jsx(bW,{})}),A.jsx("button",{className:gt.toolbarBtn,onClick:r,title:"Send Up arrow key to terminal",children:A.jsx(vW,{})}),A.jsx("button",{className:gt.toolbarBtn,onClick:a,title:"Send Down arrow key to terminal",children:A.jsx(xW,{})}),u&&A.jsx("button",{className:gt.toolbarBtn,onClick:u,title:"Scroll to bottom",children:A.jsx(CW,{})}),h&&A.jsxs("button",{className:`${gt.toolbarBtn} ${p>0?gt.bookmarkActiveBtn:""}`,onClick:h,title:p>0?`Bookmarks (${p}) — select text to add, click to toggle panel`:"Select terminal text then click to bookmark",style:{position:"relative"},children:[A.jsx(EW,{active:p>0}),p>0&&A.jsx("span",{className:gt.bookmarkBadge,children:p})]}),A.jsx("button",{className:gt.toolbarBtn,onClick:t,title:f?"Exit fullscreen (Alt+F11)":"Fullscreen (Alt+F11)",children:f?A.jsx(wW,{}):A.jsx(SW,{})}),m&&o&&A.jsx("button",{className:`${gt.toolbarBtn} ${gt.reconnectBtn}`,onClick:o,title:"Reconnect terminal",children:"RECONNECT"})]})}const AW="200px";function TW({terminalId:n,ws:e,showReconnect:t=!1,onReconnect:i,bookmarkPortalTarget:r}){const[a,l]=V.useState(()=>{try{return localStorage.getItem("terminal-theme")||"auto"}catch{return"auto"}}),[o,u]=V.useState([]),[h,p]=V.useState(!1),f=V.useRef(null),{containerRef:m,attach:g,detach:_,isFullscreen:w,toggleFullscreen:v,sendEscape:x,sendArrowUp:S,sendArrowDown:b,pasteToTerminal:C,refitTerminal:O,setTheme:M,handleTerminalOutput:D,handleTerminalReady:N,handleTerminalClosed:B,reparent:U,scrollToBottom:Y,scrollPageUp:K,scrollPageDown:H,getTerminalBookmark:J,scrollToLine:Q}=_W({ws:e,themeName:a});V.useEffect(()=>{n?g(n):_()},[n,g,_]),V.useEffect(()=>{if(!n){u([]);return}try{const $=localStorage.getItem(`term-bookmarks:${n}`);u($?JSON.parse($):[])}catch{u([])}},[n]),V.useEffect(()=>{if(n)try{localStorage.setItem(`term-bookmarks:${n}`,JSON.stringify(o))}catch{}},[n,o]),V.useEffect(()=>{requestAnimationFrame(()=>{w&&f.current?U(f.current):!w&&m.current&&U(m.current)})},[w,U,m]),V.useEffect(()=>{if(!e)return;const $=W=>{try{const ye=JSON.parse(W.data);ye.type==="terminal_output"&&ye.terminalId?D(ye.terminalId,ye.data):ye.type==="terminal_ready"&&ye.terminalId?N(ye.terminalId):ye.type==="terminal_closed"&&ye.terminalId&&B(ye.terminalId,ye.reason)}catch{}};return e.addEventListener("message",$),()=>e.removeEventListener("message",$)},[e,D,N,B]),V.useEffect(()=>{const $=()=>{document.visibilityState==="visible"&&O()};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[O]);const Z=V.useCallback($=>{l($),M($)},[M]),ie=V.useCallback(()=>{const $=J();if($){const W={id:`tbm-${Date.now()}`,terminalId:n,scrollLine:$.scrollLine,selectedText:$.selectedText,note:"",timestamp:Date.now()};u(ye=>[W,...ye]),p(!0)}else p(W=>!W)},[J,n]),ne=V.useCallback($=>{u(W=>W.filter(ye=>ye.id!==$))},[]),P=V.useCallback(($,W)=>{u(ye=>ye.map(be=>be.id===$?{...be,note:W}:be))},[]),L=V.useCallback($=>{Q($)},[Q]),F=A.jsxs("div",{className:gt.termBookmarkPanel,children:[A.jsxs("div",{className:gt.termBookmarkHeader,children:[A.jsx("span",{className:gt.termBookmarkTitle,children:"Bookmarks"}),A.jsx("button",{className:gt.termBookmarkClose,onClick:()=>p(!1),title:"Close bookmark panel",children:"✕"})]}),o.length===0?A.jsx("div",{className:gt.termBookmarkEmpty,children:"Select terminal text then click the bookmark button to save a position."}):A.jsx("div",{className:gt.termBookmarkList,children:o.map($=>A.jsxs("div",{className:gt.termBookmarkItem,children:[A.jsx("div",{className:gt.termBookmarkPreview,title:$.selectedText,children:$.selectedText.slice(0,80)}),A.jsx("textarea",{className:gt.termBookmarkNote,rows:1,placeholder:"Add note…",value:$.note,onChange:W=>P($.id,W.target.value)}),A.jsxs("div",{className:gt.termBookmarkActions,children:[A.jsx("button",{className:gt.termBookmarkJumpBtn,onClick:()=>L($.scrollLine),title:"Jump to this position",children:"Jump"}),A.jsx("button",{className:gt.termBookmarkDelBtn,onClick:()=>ne($.id),title:"Delete bookmark",children:"✕"})]})]},$.id))})]});return n?A.jsxs("div",{className:gt.wrapper,children:[A.jsx(hE,{themeName:a,onThemeChange:Z,onFullscreen:v,onSendEscape:x,onSendArrowUp:S,onSendArrowDown:b,onPaste:C,onReconnect:i,onScrollToBottom:Y,onBookmark:ie,bookmarkCount:o.length,isFullscreen:w,showReconnect:t}),A.jsxs("div",{className:gt.terminalArea,children:[A.jsx("div",{className:gt.terminalRow,children:A.jsx("div",{ref:m,className:gt.container,style:{minHeight:AW}})}),h&&(r?aE.createPortal(F,r):F),A.jsxs("div",{className:gt.mobileScrollOverlay,children:[A.jsx("button",{className:gt.mobileScrollBtn,onClick:K,title:"Scroll terminal up","aria-label":"Scroll terminal up",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"18 15 12 9 6 15"})})}),A.jsx("button",{className:gt.mobileScrollBtn,onClick:H,title:"Scroll terminal down","aria-label":"Scroll terminal down",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})]}),aE.createPortal(A.jsxs("div",{className:gt.fullscreenOverlay,style:{display:w?"flex":"none"},children:[A.jsxs("div",{className:gt.fullscreenTopbar,children:[A.jsx("span",{className:gt.fullscreenTitle,children:"Terminal"}),A.jsx(hE,{themeName:a,onThemeChange:Z,onFullscreen:v,onSendEscape:x,onSendArrowUp:S,onSendArrowDown:b,onPaste:C,onReconnect:i,onScrollToBottom:Y,onBookmark:ie,bookmarkCount:o.length,isFullscreen:w,showReconnect:t})]}),A.jsxs("div",{className:gt.fullscreenArea,children:[A.jsx("div",{ref:f,className:gt.fullscreenContainer}),A.jsxs("div",{className:gt.mobileScrollOverlay,children:[A.jsx("button",{className:gt.mobileScrollBtn,onClick:K,title:"Scroll terminal up","aria-label":"Scroll terminal up",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"18 15 12 9 6 15"})})}),A.jsx("button",{className:gt.mobileScrollBtn,onClick:H,title:"Scroll terminal down","aria-label":"Scroll terminal down",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})]})]}),document.body)]}):A.jsx("div",{className:gt.placeholder,children:A.jsxs("div",{children:["No terminal attached. Create an SSH session or select a session with a terminal.",i&&A.jsx("button",{className:gt.reconnectPlaceholderBtn,onClick:i,children:"Reconnect Terminal"})]})})}const am=["#00f0ff","#ff00aa","#a855f7","#00ff88","#ff4444","#ffaa00","#00aaff","#ff66ff","#44ff44","#ff8800","#8855ff","#00ffcc","#ff0066","#ccff00","#ff5577","#33ddff"],Ep={head:new Kn(.28,.24,.26),visor:new Kn(.24,.065,.02),antenna:new od(.007,.007,.14,4),aTip:new xs(.02,6,6),torso:new Kn(.32,.38,.2),core:new xs(.032,8,8),joint:new xs(.035,8,8),arm:new Kn(.08,.26,.08),leg:new Kn(.09,.28,.09),foot:new Kn(.1,.045,.12)};new Ih(Ep.head),new Ih(Ep.torso),new Ih(Ep.arm),new Ih(Ep.leg);const WY=new ld({color:"#2a2a3e",roughness:.3,metalness:.85}),$Y=new ld({color:"#1c1c2c",roughness:.4,metalness:.7});function MW(n){const e=new Vt(n);return new ld({color:e,emissive:e,emissiveIntensity:2,roughness:.2,metalness:.3})}function RW(n){return new cr({color:n,transparent:!0,opacity:.3})}const GY=am.map(n=>MW(n)),KY=am.map(n=>RW(n));function OW(n){if(!n||isNaN(n)||n<0)return"";const e=Math.floor(n/1e3),t=Math.floor(e/60),i=Math.floor(t/60);return i>0?`${i}h ${t%60}m`:t>0?`${t}m ${e%60}s`:`${e}s`}function NW(n){return n==="ended"?"DISCONNECTED":n==="approval"?"APPROVAL NEEDED":n==="input"?"WAITING FOR INPUT":n==="waiting"?"WAITING":n.toUpperCase()}function G_({modalId:n,children:e}){return bi(i=>i.activeModal)!==n?null:A.jsx(A.Fragment,{children:e})}function DW({session:n}){const e=i0(u=>u.client),t=V.useMemo(()=>e?.getRawSocket()??null,[e]),i=n.source==="ssh",r=i&&n.status==="ended",[a,l]=V.useState(null),o=V.useCallback(()=>{fetch(`/api/sessions/${n.sessionId}/reconnect-terminal`,{method:"POST"}).catch(()=>{})},[n.sessionId]);return A.jsxs("div",{className:We.terminalWithQueue,children:[A.jsx("div",{className:We.terminalSection,children:A.jsx(TW,{terminalId:n.terminalId,ws:t,showReconnect:r,onReconnect:i?o:void 0,bookmarkPortalTarget:a})}),A.jsxs("div",{className:We.bottomRow,children:[A.jsx(D2,{sessionId:n.sessionId,sessionStatus:n.status,terminalId:n.terminalId}),A.jsx("div",{ref:l,className:We.bookmarkPortal})]})]})}function IW(){const n=yn(v=>v.selectedSessionId),e=yn(v=>v.sessions),t=yn(v=>v.deselectSession),i=n?e.get(n):void 0;V.useEffect(()=>{if(!n)return;const v=x=>{x.key==="Escape"&&!x.target?.closest?.(".xterm")&&t()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n,t]),V.useEffect(()=>{if(n)try{localStorage.setItem("selected-session",n)}catch{}else try{localStorage.removeItem("selected-session")}catch{}},[n]);const r=V.useCallback(v=>{v.target===v.currentTarget&&t()},[t]),[a,l]=V.useState(!1),[o,u]=V.useState(()=>{try{return localStorage.getItem("active-tab")||"terminal"}catch{return"terminal"}});if(!i)return null;const h=OW(Date.now()-i.startedAt),p=NW(i.status),f=i.status==="ended",m=(i.characterModel||"robot").toLowerCase(),g=i.accentColor||am[(i.colorIndex??0)%am.length],_=k2(m),w={idle:"#00ff88",prompting:"#00e5ff",working:"#ff9100",waiting:"#00e5ff",approval:"#ffdd00",input:"#aa66ff",ended:"#ff4444",connecting:"#666"};return A.jsx("div",{className:We.overlay,onClick:r,children:A.jsxs(g6,{initialWidth:480,minWidth:320,maxWidth:Math.round(window.innerWidth*.95),side:"right",activeTab:o,children:[A.jsx("button",{className:We.closeBtn,onClick:t,title:"Close",children:"×"}),A.jsx("button",{className:We.collapseBtn,onClick:()=>l(v=>!v),title:a?"Expand header":"Collapse header",children:a?"▼":"▲"}),a?A.jsxs("div",{className:We.headerCompact,children:[A.jsx("span",{className:We.headerCompactName,children:i.projectName}),A.jsx("span",{className:`${We.detailStatusBadge} ${f?"disconnected":i.status}`,children:p}),h&&A.jsx("span",{className:We.detailDuration,children:h})]}):A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:We.header,children:[A.jsxs("div",{className:We.charPreview,style:{width:64,height:80,borderRadius:6,border:`1px solid ${w[i.status]??"#666"}40`,background:`${w[i.status]??"#666"}10`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},children:[A.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:`${g}30`,border:`2px solid ${g}`,boxShadow:`0 0 8px ${g}40`}}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:8,fontWeight:700,letterSpacing:.5,color:g,textTransform:"uppercase",opacity:.8},children:_})]}),A.jsxs("div",{className:We.headerText,children:[A.jsx("div",{className:We.headerTop,children:A.jsxs("div",{className:We.headerTitles,children:[A.jsx("h3",{children:i.projectName}),i.title&&A.jsx("div",{className:We.titleRow,children:A.jsx("span",{style:{fontSize:"11px",color:"var(--text-dim)",fontStyle:"italic"},children:i.title})})]})}),A.jsxs("div",{className:We.meta,children:[A.jsx("span",{className:`${We.detailStatusBadge} ${f?"disconnected":i.status}`,children:p}),i.model&&A.jsx("span",{className:We.detailModel,children:i.model}),h&&A.jsx("span",{className:We.detailDuration,children:h})]})]})]}),A.jsx(MV,{session:i})]}),A.jsx(S6,{terminalContent:A.jsx(DW,{session:i}),promptsContent:A.jsx(E6,{prompts:i.promptHistory||[],previousSessions:i.previousSessions}),notesContent:A.jsx(T6,{sessionId:i.sessionId}),activityContent:A.jsx(k6,{events:i.events||[],toolLog:i.toolLog||[],responseLog:i.responseLog||[]}),summaryContent:A.jsx(M6,{summary:i.summary}),queueContent:A.jsx(D2,{sessionId:i.sessionId,sessionStatus:i.status,terminalId:i.terminalId}),projectContent:i.projectPath?A.jsx(xV,{projectPath:i.projectPath}):A.jsx("div",{className:We.tabEmpty,children:"No project path detected for this session"}),onTabChange:u,sessionId:i.sessionId}),A.jsx(G_,{modalId:Gb,children:A.jsx(SV,{})}),A.jsx(G_,{modalId:Kb,children:A.jsx(wV,{})}),A.jsx(G_,{modalId:Yb,children:A.jsx(CV,{})})]})})}function LW(n){const e=n.target?.tagName;return!!(e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||n.target?.isContentEditable)}let kp=!1;const BW=new Set;function zW(){kp=!kp;for(const n of BW)n(kp);return kp}function PW(){const n=bi(i=>i.openModal),e=bi(i=>i.closeModal),t=bi(i=>i.activeModal);V.useEffect(()=>{function i(r){const a=bi.getState().activeModal,l=yn.getState().selectedSessionId;if(r.key==="Escape"){if(a)e();else{if(r.target?.closest?.(".xterm"))return;l&&yn.getState().deselectSession()}return}if(!LW(r)){if(r.key==="F11"&&r.altKey){r.preventDefault(),document.fullscreenElement?document.exitFullscreen().catch(()=>{}):document.documentElement.requestFullscreen().catch(()=>{});return}if(!(r.ctrlKey||r.metaKey||r.altKey))switch(r.key){case"/":{r.preventDefault(),document.querySelector("[data-search-input]")?.focus();break}case"?":r.preventDefault(),a==="shortcuts"?e():n("shortcuts");break;case"S":case"s":r.preventDefault(),a==="settings"?e():n("settings");break;case"T":case"t":r.preventDefault(),n("new-session");break;case"K":case"k":l&&(r.preventDefault(),FW(l));break;case"A":case"a":l&&(r.preventDefault(),jW(l));break;case"M":case"m":{r.preventDefault();const o=zW();Nt(o?"Sound muted":"Sound unmuted","info",1500);break}}}}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n,e,t])}async function FW(n){try{const t=await(await fetch(`/api/sessions/${n}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})})).json();t.ok?Nt("Session killed","info"):Nt(t.error||"Failed to kill session","error")}catch{Nt("Network error","error")}}async function jW(n){try{const t=await(await fetch(`/api/sessions/${n}/archive`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();t.ok?Nt("Session archived","info"):Nt(t.error||"Failed to archive session","error")}catch{Nt("Network error","error")}}function UW(){const n=V.useRef(!1);V.useEffect(()=>{n.current||(n.current=!0,(async()=>{try{const t=await Kt.settings.toArray();if(t.length===0)return;const i={};for(const r of t){const{key:a,value:l}=r;if(typeof l=="string")try{const o=JSON.parse(l);if(typeof o=="object"&&o!==null){i[a]=o;continue}}catch{}i[a]=l}Gt.getState().loadFromDb(i)}catch{}})())},[]);const e=Gt(t=>t.soundSettings.volume);V.useEffect(()=>{vs.setVolume(e)},[e]),V.useEffect(()=>{if(vs.isUnlocked())return;function t(){vs.unlock(),document.removeEventListener("click",t),document.removeEventListener("keydown",t),document.removeEventListener("touchstart",t)}return document.addEventListener("click",t),document.addEventListener("keydown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("click",t),document.removeEventListener("keydown",t),document.removeEventListener("touchstart",t)}},[])}const HW={idle:"#00ff88",prompting:"#00e5ff",working:"#ff9100",waiting:"#00e5ff",approval:"#ffdd00",input:"#aa66ff",ended:"#ff4444",connecting:"#666"},dE={working:0,prompting:1,approval:2,input:2,waiting:3,idle:4,connecting:5,ended:6};function fE(n){return[...n].sort((e,t)=>{const i=dE[e.status]??5,r=dE[t.status]??5;return i!==r?i-r:(e.title||"Unnamed").localeCompare(t.title||"Unnamed")})}function qW({session:n,isSelected:e,onSelect:t,onClose:i,onTitleSave:r}){const a=HW[n.status]??"#888",l=n.title||"Unnamed",o=n.label,[u,h]=V.useState(!1),[p,f]=V.useState(l),m=V.useRef(null);V.useEffect(()=>{u&&(m.current?.focus(),m.current?.select())},[u]);const g=()=>{h(!1);const _=p.trim();_&&_!==l?r(n.sessionId,_):f(l)};return A.jsxs("button",{"data-session-id":n.sessionId,"data-status":n.status,onClick:()=>{u||t(n.sessionId)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 10px",border:e?`1px solid ${a}`:"1px solid rgba(255,255,255,0.06)",borderRadius:3,background:e?`rgba(${WW(a)},0.12)`:"rgba(255,255,255,0.02)",cursor:u?"default":"pointer",textAlign:"left",fontFamily:"'JetBrains Mono', monospace",transition:"all 0.15s ease"},onMouseEnter:_=>{e||(_.currentTarget.style.background="rgba(255,255,255,0.06)",_.currentTarget.style.borderColor="rgba(255,255,255,0.15)")},onMouseLeave:_=>{e||(_.currentTarget.style.background="rgba(255,255,255,0.02)",_.currentTarget.style.borderColor="rgba(255,255,255,0.06)")},children:[A.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:a,boxShadow:`0 0 6px ${a}`,flexShrink:0,alignSelf:"flex-start",marginTop:4}}),A.jsxs("div",{style:{flex:1,minWidth:0},children:[o&&A.jsx("span",{style:{display:"inline-block",fontSize:9,letterSpacing:.5,color:"rgba(0,240,255,0.9)",background:"rgba(0,240,255,0.1)",border:"1px solid rgba(0,240,255,0.2)",borderRadius:2,padding:"0px 4px",marginBottom:2,lineHeight:1.5,textTransform:"uppercase"},children:o}),u?A.jsx("input",{ref:m,value:p,onChange:_=>f(_.target.value),onBlur:g,onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),g()),_.key==="Escape"&&(f(l),h(!1))},onClick:_=>_.stopPropagation(),style:{width:"100%",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(0,240,255,0.4)",borderRadius:2,color:"#fff",fontSize:12,fontFamily:"inherit",padding:"1px 4px",outline:"none",lineHeight:1.3}}):A.jsx("div",{style:{fontSize:12,color:e?"#fff":"rgba(255,255,255,0.75)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.3},children:l}),A.jsx("div",{style:{fontSize:10,color:a,letterSpacing:1,textTransform:"uppercase",lineHeight:1.3},children:n.status})]}),!u&&A.jsx("span",{role:"button",tabIndex:-1,onClick:_=>{_.stopPropagation(),f(l),h(!0)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),f(l),h(!0))},style:{flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2,color:"rgba(255,255,255,0.2)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:_=>{_.currentTarget.style.color="rgba(0,240,255,0.8)"},onMouseLeave:_=>{_.currentTarget.style.color="rgba(255,255,255,0.2)"},children:A.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),A.jsx("path",{d:"m15 5 4 4"})]})}),A.jsx("span",{role:"button",tabIndex:-1,onClick:_=>{_.stopPropagation(),i(n.sessionId)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),i(n.sessionId))},style:{flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2,fontSize:10,lineHeight:1,color:"rgba(255,255,255,0.25)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:_=>{_.currentTarget.style.color="#ff4444",_.currentTarget.style.background="rgba(255,68,68,0.15)"},onMouseLeave:_=>{_.currentTarget.style.color="rgba(255,255,255,0.25)",_.currentTarget.style.background="transparent"},children:"✕"})]})}function VW({name:n,count:e,collapsed:t,onToggle:i}){return A.jsxs("div",{onClick:i,style:{display:"flex",alignItems:"center",gap:6,padding:"6px 4px 4px",cursor:"pointer",userSelect:"none"},children:[A.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.35)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.15s ease",transform:t?"rotate(-90deg)":"rotate(0deg)",flexShrink:0},children:A.jsx("polyline",{points:"6 9 12 15 18 9"})}),A.jsx("span",{style:{fontSize:11,letterSpacing:1.5,color:"rgba(255,255,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),A.jsx("span",{style:{fontSize:10,color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace"},children:e})]})}function WW(n){const e=n.replace("#",""),t=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);return`${t},${i},${r}`}const _A="sidebar-filter-mode";function $W(){try{const n=localStorage.getItem(_A);return n==="all"||n==="ssh"||n==="others"?n:"all"}catch{return"all"}}function GW(n){try{localStorage.setItem(_A,n)}catch{}}function KW(){const n=yn(C=>C.sessions),e=yn(C=>C.selectedSessionId),t=yn(C=>C.removeSession),i=yn(C=>C.updateSession),r=Gs(C=>C.rooms),[a,l]=V.useState(!1),[o,u]=V.useState(new Set),[h,p]=V.useState($W),f=V.useCallback(C=>{u(O=>{const M=new Set(O);return M.has(C)?M.delete(C):M.add(C),M})},[]),m=V.useCallback(C=>{p(C),GW(C)},[]),g=V.useMemo(()=>{const C=[...n.values()].filter(B=>!(B.status==="ended"||h==="ssh"&&B.source!=="ssh"||h==="others"&&B.source==="ssh")),O=new Set,M=[],D=[...r].filter(B=>B.roomIndex!=null).sort((B,U)=>(B.roomIndex??0)-(U.roomIndex??0));for(const B of D){const U=C.filter(Y=>B.sessionIds.includes(Y.sessionId));if(U.length>0){for(const Y of U)O.add(Y.sessionId);M.push({id:B.id,name:B.name,sessions:fE(U)})}}const N=C.filter(B=>!O.has(B.sessionId));return N.length>0&&M.push({id:"__common__",name:"Common Area",sessions:fE(N)}),M},[n,r,h]),_=V.useMemo(()=>g.reduce((C,O)=>C+O.sessions.length,0),[g]),w=yn(C=>C.selectSession),v=V.useCallback(C=>{w(C),window.dispatchEvent(new CustomEvent("robot-select",{detail:{sessionId:C}}))},[w]),x=V.useCallback(C=>{t(C),fetch(`/api/sessions/${C}`,{method:"DELETE"}).catch(()=>{})},[t]),S=V.useCallback((C,O)=>{const M=n.get(C);M&&i({...M,title:O}),fetch(`/api/sessions/${C}/title`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:O})}).catch(()=>{})},[n,i]);return V.useMemo(()=>[...n.values()].some(C=>C.status!=="ended"),[n])?A.jsxs("div",{style:{position:"absolute",top:16,left:20,width:a?"auto":280,maxHeight:"calc(100vh - 100px)",overflowY:a?"hidden":"auto",background:"color-mix(in srgb, var(--bg-panel) 85%, transparent)",backdropFilter:"blur(20px)",border:"1px solid var(--border-accent)",borderRadius:4,padding:a?"10px 12px":"14px 12px",pointerEvents:"all",zIndex:11,boxShadow:"0 0 12px var(--glow-accent), inset 0 0 24px var(--glow-accent)",transition:"width 0.2s ease, padding 0.2s ease"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",marginBottom:a?0:4,paddingLeft:2,userSelect:"none"},onClick:()=>l(C=>!C),children:[A.jsxs("span",{style:{fontSize:12,letterSpacing:2,color:"rgba(0,240,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",flex:1},children:["Agents (",_,")"]}),A.jsx("div",{onClick:C=>C.stopPropagation(),style:{display:"flex",borderRadius:3,overflow:"hidden",border:"1px solid rgba(255,255,255,0.1)",marginRight:6},children:["all","ssh","others"].map(C=>{const O=h===C,M=C==="all"?"ALL":C==="ssh"?"SSH":"OTHERS";return A.jsx("button",{onClick:()=>m(C),style:{fontSize:9,letterSpacing:.5,padding:"2px 6px",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"all 0.15s ease",background:O?"rgba(0,240,255,0.15)":"transparent",color:O?"rgba(0,240,255,0.9)":"rgba(255,255,255,0.3)",border:"none",borderRight:C!=="others"?"1px solid rgba(255,255,255,0.08)":"none",lineHeight:1.4},children:M},C)})}),A.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(0,240,255,0.4)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:a?"rotate(-90deg)":"rotate(0deg)"},children:A.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!a&&A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:_===0?A.jsxs("div",{style:{padding:"16px 8px",textAlign:"center",fontSize:11,color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:.5},children:["No ",h==="ssh"?"SSH":h==="others"?"other":""," sessions"]}):g.map(C=>{const O=o.has(C.id);return A.jsxs("div",{children:[A.jsx(VW,{name:C.name,count:C.sessions.length,collapsed:O,onToggle:()=>f(C.id)}),!O&&A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3,paddingLeft:4},children:C.sessions.map(M=>A.jsx(qW,{session:M,isSelected:e===M.sessionId,onSelect:v,onClose:x,onTitleSave:S},M.sessionId))})]},C.id)})})]}):null}const YW=[18,16,18],XW=[0,1,0];let ZW=1;const JW=Tl(n=>({pendingTarget:null,isAnimating:!1,flyTo:(e,t)=>n({pendingTarget:{position:e,lookAt:t,requestId:ZW++},isAnimating:!0}),completeAnimation:()=>n({pendingTarget:null,isAnimating:!1})})),bA=8,nd=2,pE=bA+nd,Lo=bA/2,Nr=4,YY=2,XY=.08,ZY=1.5;function JY(n){const e=[];for(const t of n){const[i]=t.center;e.push({roomIndex:t.index,side:"south",outside:new se(i,0,t.bounds.maxZ+1),inside:new se(i,0,t.bounds.maxZ-1)}),e.push({roomIndex:t.index,side:"north",outside:new se(i,0,t.bounds.minZ-1),inside:new se(i,0,t.bounds.minZ+1)})}return e}function QY(n,e,t,i,r,a){if(i===r)return[t];if(i<0&&r<0)return[t];const l=[];function o(u,h,p){const f=a.filter(_=>_.roomIndex===u);if(f.length===0)return;let m=f[0],g=(m.outside.x-h)**2+(m.outside.z-p)**2;for(let _=1;_<f.length;_++){const w=(f[_].outside.x-h)**2+(f[_].outside.z-p)**2;w<g&&(m=f[_],g=w)}return m}if(i>=0){const u=o(i,t.x,t.z);u&&(l.push(u.inside.clone()),l.push(u.outside.clone()))}if(r>=0){const u=o(r,n,e);u&&(l.push(u.outside.clone()),l.push(u.inside.clone()))}return l.push(t),l}function ja(n){const e=n%Nr,t=Math.floor(n/Nr),i=(e-(Nr-1)/2)*pE,r=t*pE;return[i,0,r]}function vA(n){const[e,,t]=ja(n);return{minX:e-Lo,maxX:e+Lo,minZ:t-Lo,maxZ:t+Lo}}const mE=14,QW=10,gE=Math.PI/4;function e$(n){const[e,,t]=ja(n);return{lookAt:[e,1,t],position:[e+Math.sin(gE)*mE,QW,t+Math.cos(gE)*mE]}}function eX(n){return n.filter(e=>e.roomIndex!=null).map(e=>({index:e.roomIndex,roomId:e.id,name:e.name,center:ja(e.roomIndex),bounds:vA(e.roomIndex),stripColor:e.roomIndex%2===0?0:1}))}function t$(n){const e=[];for(const t of n){const[i,,r]=t.center,a=5,l=1.2,o=r-(a-1)*l/2;for(let u=0;u<a;u++){const h=o+u*l;e.push({x:i-3,z:h,rotation:Math.PI/2,zone:t.index}),e.push({x:i+3,z:h,rotation:-Math.PI/2,zone:t.index})}}return e}function tX(n){return t$(n).map((t,i)=>{const r=t.x+.65*Math.sin(t.rotation),a=t.z+.65*Math.cos(t.rotation);return{idx:i,zone:t.zone,seatPos:new se(r,0,a),faceRot:t.rotation+Math.PI,occupantId:null}})}function nX(n,e){const t=[];if(n.length===0)for(let i=0;i<5;i++)for(let r=0;r<2;r++)t.push({x:(r-.5)*3,z:3+i*1.5,rotation:r===0?Math.PI/2:-Math.PI/2});else{const i=Math.max(...n.map(f=>Math.floor(f.index/Nr))),r=Math.min(Nr-1,Math.max(...n.map(f=>f.index%Nr))),a=Math.min(...n.map(f=>f.index%Nr)),o=ja(i*Nr)[2]+Lo+nd+3,u=ja(a),h=ja(r),p=(u[0]+h[0])/2;for(let f=0;f<5;f++)for(let m=0;m<2;m++)t.push({x:p+(m-.5)*3,z:o+f*1.5,rotation:m===0?Math.PI/2:-Math.PI/2})}return t.map((i,r)=>{const a=i.x+.65*Math.sin(i.rotation),l=i.z+.65*Math.cos(i.rotation);return{idx:e+r,zone:-1,seatPos:new se(a,0,l),faceRot:i.rotation+Math.PI,occupantId:null}})}function iX(n,e,t){for(const i of t)if(n+.25>i.minX&&n-.25<i.maxX&&e+.25>i.minZ&&e-.25<i.maxZ)return!0;return!1}function n$(n){if(n.length===0)return 15;let e=10;for(const t of n){const[i,,r]=t.center;e=Math.max(e,Math.abs(i)+Lo+2,Math.abs(r)+Lo+2)}if(n.length>0){const t=Math.max(...n.map(a=>Math.floor(a.index/Nr))),i=ja(t*Nr);e=Math.max(e,Math.abs(i[2])+Lo+nd+8);const r=Math.min(...n.map(a=>a.bounds.minZ));e=Math.max(e,Math.abs(r)+nd+8)}return e}function rX(n,e,t){for(const i of t){const r=i.bounds;if(n>=r.minX&&n<=r.maxX&&e>=r.minZ&&e<=r.maxZ)return i.index}return-1}function sX(n){const e=vA(n),t=new se;return t.set(e.minX+.8+Math.random()*(e.maxX-e.minX-1.6),0,e.minZ+.8+Math.random()*(e.maxZ-e.minZ-1.6)),t}function aX(n){const e=new se,t=Math.min(n,5);return e.set((Math.random()-.5)*t*2,0,(Math.random()-.5)*t*2),e}const i$=10,Rh=i$/2;function oX(n){let e,t;if(n.length===0)e=-8,t=0;else{e=Math.min(...n.map(p=>p.bounds.minZ))-nd-Rh-1;const l=Math.min(...n.map(p=>p.index%Nr)),o=Math.min(Nr-1,Math.max(...n.map(p=>p.index%Nr))),u=ja(l),h=ja(o);t=(u[0]+h[0])/2}const i=[],r=3;for(let a=0;a<2;a++)for(let l=0;l<2;l++){const o=t+(l-.5)*r,u=e+(a-.5)*r;i.push({pos:new se(o-.8,0,u),faceRot:Math.PI/2}),i.push({pos:new se(o+.8,0,u),faceRot:-Math.PI/2})}return[{type:"coffee",center:[t,0,e],bounds:{minX:t-Rh,maxX:t+Rh,minZ:e-Rh,maxZ:e+Rh},stations:i}]}function lX(n,e){const t=[];let i=e;for(const r of n)for(const l of r.stations)t.push({idx:i,zone:-2,seatPos:l.pos.clone(),faceRot:l.faceRot,occupantId:null}),i++;return t}function cX(n){const e=n$(n);return Math.max(20,e*2+6)}const qh={fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",fontSize:10,letterSpacing:1.5,textTransform:"uppercase",padding:"7px 12px",borderRadius:2,cursor:"pointer",transition:"all 0.15s ease"};function r$(){const n=Gs(S=>S.rooms),e=Gs(S=>S.createRoom),t=Gs(S=>S.renameRoom),i=Gs(S=>S.deleteRoom),r=yn(S=>S.sessions),a=JW(S=>S.flyTo),[l,o]=V.useState(!1),[u,h]=V.useState(null),[p,f]=V.useState(""),m=V.useCallback(()=>{const S=n.length+1;e(`Room ${S}`)},[n.length,e]),g=V.useCallback(S=>{h(S.id),f(S.name)},[]),_=V.useCallback(()=>{u&&p.trim()&&t(u,p.trim()),h(null),f("")},[u,p,t]),w=V.useCallback(S=>{const b=e$(S);a(b.position,b.lookAt)},[a]),v=V.useCallback(()=>{a(YW,XW)},[a]),x=V.useMemo(()=>[...n].sort((S,b)=>(S.roomIndex??999)-(b.roomIndex??999)),[n]);return A.jsxs("div",{style:{marginTop:10,borderTop:"1px solid rgba(0,240,255,0.1)",paddingTop:8},children:[A.jsxs("button",{onClick:()=>o(!l),style:{...qh,display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"4px 0",border:"none",background:"none",color:"rgba(0,240,255,0.5)",fontSize:9,letterSpacing:2},children:[A.jsxs("span",{children:["Rooms (",n.length,")"]}),A.jsx("span",{style:{fontSize:10},children:l?"▴":"▾"})]}),l&&A.jsxs("div",{style:{marginTop:6,display:"flex",flexDirection:"column",gap:6},children:[A.jsx("button",{onClick:v,style:{...qh,width:"100%",border:"1px solid rgba(0,240,255,0.28)",background:"rgba(0,240,255,0.06)",color:"#00f0ff",display:"flex",alignItems:"center",justifyContent:"center",gap:6},onMouseEnter:S=>{S.currentTarget.style.background="rgba(0,240,255,0.16)",S.currentTarget.style.borderColor="rgba(0,240,255,0.5)"},onMouseLeave:S=>{S.currentTarget.style.background="rgba(0,240,255,0.06)",S.currentTarget.style.borderColor="rgba(0,240,255,0.28)"},children:"Overview"}),x.map(S=>{const b=S.sessionIds.filter(C=>{const O=r.get(C);return O&&O.status!=="ended"}).length;return A.jsxs("div",{onClick:()=>{u!==S.id&&S.roomIndex!=null&&w(S.roomIndex)},style:{padding:"6px 8px",borderRadius:3,border:"1px solid rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.04)",cursor:u===S.id?"default":"pointer"},onMouseEnter:C=>{u!==S.id&&(C.currentTarget.style.background="rgba(0,240,255,0.1)",C.currentTarget.style.borderColor="rgba(0,240,255,0.4)")},onMouseLeave:C=>{C.currentTarget.style.background="rgba(0,240,255,0.04)",C.currentTarget.style.borderColor="rgba(0,240,255,0.2)"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[u===S.id?A.jsx("input",{value:p,onChange:C=>f(C.target.value),onBlur:_,onKeyDown:C=>{C.key==="Enter"&&_()},onClick:C=>C.stopPropagation(),autoFocus:!0,style:{flex:1,background:"rgba(0,0,0,0.3)",border:"1px solid rgba(0,240,255,0.3)",color:"#fff",fontSize:10,fontFamily:"'JetBrains Mono', monospace",padding:"2px 4px",borderRadius:2,outline:"none"}}):A.jsx("span",{style:{fontSize:10,fontFamily:"'JetBrains Mono', monospace",color:"#ddd",flex:1},children:S.name}),u!==S.id&&A.jsxs("div",{style:{display:"flex",gap:2},children:[A.jsx("button",{onClick:C=>{C.stopPropagation(),g(S)},style:{background:"none",border:"none",color:"rgba(0,240,255,0.4)",cursor:"pointer",fontSize:10,minWidth:44,minHeight:44,display:"flex",alignItems:"center",justifyContent:"center"},title:"Rename",children:"✎"}),A.jsx("button",{onClick:C=>{C.stopPropagation(),i(S.id)},style:{background:"none",border:"none",color:"rgba(255,68,68,0.5)",cursor:"pointer",fontSize:10,minWidth:44,minHeight:44,display:"flex",alignItems:"center",justifyContent:"center"},title:"Delete room",children:"×"})]})]}),b>0&&A.jsxs("div",{style:{marginTop:4,fontSize:9,fontFamily:"'JetBrains Mono', monospace",color:"rgba(255,255,255,0.35)",padding:"1px 4px"},children:[b," session",b!==1?"s":""]})]},S.id)}),n.length===0&&A.jsx("div",{style:{fontSize:9,color:"rgba(255,255,255,0.2)",textAlign:"center",padding:"6px 0",fontFamily:"'Share Tech Mono', monospace"},children:"No rooms yet"}),A.jsx("button",{onClick:m,style:{...qh,width:"100%",border:"1px dashed rgba(0,255,136,0.3)",background:"rgba(0,255,136,0.04)",color:"#00ff88"},onMouseEnter:S=>{S.currentTarget.style.background="rgba(0,255,136,0.12)",S.currentTarget.style.borderColor="rgba(0,255,136,0.5)"},onMouseLeave:S=>{S.currentTarget.style.background="rgba(0,255,136,0.04)",S.currentTarget.style.borderColor="rgba(0,255,136,0.3)"},children:"+ New Room"})]})]})}function s$({sessionCount:n}){const e=Gt(l=>l.soundSettings.enabled),t=Gt(l=>l.updateSoundSettings),i=Gt(l=>l.scene3dEnabled),r=Gt(l=>l.setScene3dEnabled),a=()=>{const l=!e;t({enabled:l}),l&&vs.unlock()};return A.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:10},children:A.jsxs("div",{style:{position:"absolute",bottom:16,right:20,background:"color-mix(in srgb, var(--bg-panel) 85%, transparent)",backdropFilter:"blur(20px)",border:"1px solid var(--border-accent)",borderRadius:4,padding:"14px 18px",pointerEvents:"all",minWidth:200,maxWidth:260,maxHeight:"calc(100vh - 80px)",overflowY:"auto",boxShadow:"0 0 12px var(--glow-accent), inset 0 0 24px var(--glow-accent)"},children:[A.jsx("div",{style:{fontSize:9,letterSpacing:2,color:"rgba(0,240,255,0.4)",textTransform:"uppercase",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace"},children:"Units Online"}),A.jsx("div",{style:{fontFamily:"'Orbitron', 'JetBrains Mono', sans-serif",fontSize:28,fontWeight:700,color:"#fff",margin:"2px 0 10px",lineHeight:1},children:n}),A.jsx("button",{onClick:a,style:{...qh,width:"100%",border:`1px solid ${e?"rgba(0,240,255,0.28)":"rgba(255,68,68,0.4)"}`,background:e?"rgba(0,240,255,0.08)":"rgba(255,68,68,0.12)",color:e?"#00f0ff":"#ff4444"},onMouseEnter:l=>{l.currentTarget.style.background=e?"rgba(0,240,255,0.16)":"rgba(255,68,68,0.2)"},onMouseLeave:l=>{l.currentTarget.style.background=e?"rgba(0,240,255,0.08)":"rgba(255,68,68,0.12)"},children:e?"Sound On":"Muted"}),A.jsx("button",{onClick:()=>r(!i),title:i?"Disable 3D scene to save CPU/GPU":"Enable 3D scene",style:{...qh,width:"100%",marginTop:6,border:`1px solid ${i?"rgba(0,240,255,0.28)":"rgba(255,145,0,0.4)"}`,background:i?"rgba(0,240,255,0.08)":"rgba(255,145,0,0.12)",color:i?"#00f0ff":"#ff9100"},onMouseEnter:l=>{l.currentTarget.style.background=i?"rgba(0,240,255,0.16)":"rgba(255,145,0,0.2)"},onMouseLeave:l=>{l.currentTarget.style.background=i?"rgba(0,240,255,0.08)":"rgba(255,145,0,0.12)"},children:i?"3D On":"3D Off"}),A.jsx(r$,{}),A.jsx("div",{style:{fontSize:8,color:"rgba(255,255,255,0.16)",marginTop:10,lineHeight:1.6,textAlign:"center",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace"},children:"Drag to orbit · Scroll to zoom"})]})})}const a$=V.lazy(()=>ou(()=>import("./CyberdromeScene-w4bk6IXJ.js"),__vite__mapDeps([0,1])));class o$ extends V.Component{state={hasError:!1,error:""};static getDerivedStateFromError(e){return{hasError:!0,error:e.message}}componentDidCatch(e,t){console.error("3D Scene crashed:",e,t.componentStack)}render(){return this.state.hasError?A.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",background:"#0e0c1a",color:"#ff4444",fontFamily:"'JetBrains Mono', monospace",fontSize:12,letterSpacing:1,gap:16},children:[A.jsx("div",{children:"3D SCENE ERROR"}),A.jsx("div",{style:{color:"#888",maxWidth:400,textAlign:"center"},children:this.state.error}),A.jsx("button",{onClick:()=>this.setState({hasError:!1,error:""}),style:{background:"#1a1a2e",border:"1px solid #00f0ff",color:"#00f0ff",padding:"8px 16px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"RETRY"})]}):this.props.children}}function l$(){const n=yn(t=>t.sessions),e=Array.from(n.values()).filter(t=>t.status!=="ended").length;return A.jsxs("div",{style:{position:"absolute",inset:0,background:"var(--bg-primary, #0a0a1a)"},children:[A.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.06)",fontFamily:"'Share Tech Mono', 'JetBrains Mono', monospace",fontSize:14,letterSpacing:4,textTransform:"uppercase",userSelect:"none"},children:"3D Scene Paused"}),A.jsx(s$,{sessionCount:e}),A.jsx(KW,{})]})}function c$(){return Gt(e=>e.scene3dEnabled)?A.jsx("div",{style:{position:"absolute",inset:0},children:A.jsx(o$,{children:A.jsx(V.Suspense,{fallback:A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",background:"#0e0c1a",color:"#00f0ff",fontFamily:"'JetBrains Mono', monospace",fontSize:12,letterSpacing:2},children:"INITIALIZING CYBERDROME..."}),children:A.jsx(a$,{})})})}):A.jsx("div",{style:{position:"absolute",inset:0},children:A.jsx(l$,{})})}const u$=V.lazy(()=>ou(()=>import("./HistoryView--XwKlCyd.js"),__vite__mapDeps([2,3,4]))),h$=V.lazy(()=>ou(()=>import("./TimelineView-CoTsTAGd.js"),__vite__mapDeps([5,3,6,1,7]))),d$=V.lazy(()=>ou(()=>import("./AnalyticsView-DVDqblSH.js"),__vite__mapDeps([8,3,6,1,7]))),f$=V.lazy(()=>ou(()=>import("./QueueView-Bj-e0m_U.js"),__vite__mapDeps([9,10]))),p$=V.lazy(()=>ou(()=>import("./ProjectBrowserView-CTN5CmBa.js"),[])),m$=new rO({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function g$(){return PW(),A.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[A.jsx(DB,{}),A.jsx(f5,{}),A.jsx("main",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative"},children:A.jsx(V.Suspense,{fallback:A.jsx("div",{style:{padding:"2rem",color:"#8888aa",textAlign:"center"},children:"Loading..."}),children:A.jsx(XM,{})})}),A.jsx(w5,{}),A.jsx(zB,{}),A.jsx(AB,{}),A.jsx(H5,{}),A.jsx(K5,{}),A.jsx(X5,{}),A.jsx(IW,{})]})}function y$({token:n}){return UW(),RO(n),A.jsx(wR,{children:A.jsxs(JM,{children:[A.jsx(La,{path:"/project-browser",element:A.jsx(V.Suspense,{fallback:A.jsx("div",{style:{padding:"2rem",color:"#8888aa",background:"#0a0a1a",height:"100vh"},children:"Loading..."}),children:A.jsx(p$,{})})}),A.jsxs(La,{element:A.jsx(g$,{}),children:[A.jsx(La,{path:"/",element:A.jsx(c$,{})}),A.jsx(La,{path:"/history",element:A.jsx(u$,{})}),A.jsx(La,{path:"/timeline",element:A.jsx(h$,{})}),A.jsx(La,{path:"/analytics",element:A.jsx(d$,{})}),A.jsx(La,{path:"/queue",element:A.jsx(f$,{})}),A.jsx(La,{path:"*",element:A.jsx(YM,{to:"/",replace:!0})})]})]})})}function _$(){const{token:n,loading:e,needsLogin:t,login:i}=lO();return e?A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh",background:"#0a0a1a",color:"#8888aa",fontFamily:"'JetBrains Mono', monospace"},children:"Connecting..."}):t?A.jsx(BO,{onLogin:i}):A.jsx(y$,{token:n})}function b$(){return A.jsx(sO,{client:m$,children:A.jsx(_$,{})})}bs.getState().loadFromDb();const xA=document.getElementById("root");if(!xA)throw new Error("Root element not found");YT.createRoot(xA).render(A.jsx(V.StrictMode,{children:A.jsx(b$,{})}));export{NK as $,lt as A,MK as B,Jr as C,Vt as D,se as E,rb as F,$E as G,wn as H,zt as I,jS as J,US as K,X0 as L,tn as M,CG as N,Rr as O,vV as P,pm as Q,v$ as R,um as S,I3 as T,G0 as U,is as V,Ys as W,G$ as X,GE as Y,r0 as Z,BS as _,E$ as a,W$ as a$,an as a0,xt as a1,CI as a2,Cs as a3,v2 as a4,Dy as a5,Po as a6,Qe as a7,Qr as a8,hY as a9,lG as aA,uG as aB,NS as aC,rG as aD,iG as aE,nG as aF,a0 as aG,s0 as aH,M3 as aI,T3 as aJ,A3 as aK,Br as aL,fK as aM,dK as aN,pK as aO,uK as aP,hK as aQ,cK as aR,mK as aS,lK as aT,Uc as aU,ea as aV,RI as aW,OI as aX,Z0 as aY,ii as aZ,V$ as a_,$K as aa,Gh as ab,U3 as ac,o0 as ad,BG as ae,mm as af,HD as ag,Yh as ah,Fa as ai,H3 as aj,ts as ak,Ks as al,ZE as am,IS as an,Q$ as ao,J$ as ap,OS as aq,pG as ar,fG as as,dG as at,hG as au,oG as av,cG as aw,DS as ax,sG as ay,aG as az,aE as b,mG as b$,x3 as b0,$$ as b1,iu as b2,WK as b3,JK as b4,V3 as b5,q3 as b6,YE as b7,N3 as b8,L3 as b9,aN as bA,oN as bB,lN as bC,cN as bD,uN as bE,hN as bF,dN as bG,fN as bH,pN as bI,mN as bJ,gN as bK,yN as bL,_N as bM,bN,vN as bO,xN as bP,SN as bQ,wN as bR,CN as bS,EN as bT,kN as bU,xG as bV,vG as bW,bG as bX,_G as bY,yG as bZ,gG as b_,B3 as ba,QK as bb,mb as bc,z3 as bd,P3 as be,R3 as bf,O3 as bg,D3 as bh,F3 as bi,j3 as bj,KE as bk,W3 as bl,$3 as bm,G3 as bn,K3 as bo,Y3 as bp,X3 as bq,Z3 as br,J3 as bs,Q3 as bt,eN as bu,tN as bv,nN as bw,iN as bx,rN as by,sN as bz,D0 as c,FY as c$,F$ as c0,j$ as c1,U$ as c2,RS as c3,Z$ as c4,X$ as c5,Y$ as c6,K$ as c7,C3 as c8,E3 as c9,t2 as cA,Q0 as cB,e2 as cC,Up as cD,wG as cE,SG as cF,W0 as cG,vi as cH,eG as cI,tG as cJ,XE as cK,PS as cL,XI as cM,gL as cN,Gp as cO,tY as cP,gY as cQ,mY as cR,eY as cS,qD as cT,PY as cU,LS as cV,rL as cW,pY as cX,S2 as cY,dY as cZ,cY as c_,QN as ca,VK as cb,k3 as cc,hu as cd,VG as ce,qK as cf,Kn as cg,gm as ch,Js as ci,MG as cj,OG as ck,RG as cl,TG as cm,AG as cn,kG as co,EG as cp,kL as cq,zS as cr,fm as cs,w3 as ct,du as cu,hD as cv,uD as cw,ON as cx,EK as cy,pD as cz,PR as d,OY as d$,RN as d0,q$ as d1,PD as d2,s2 as d3,fu as d4,EY as d5,or as d6,BY as d7,LY as d8,eL as d9,rY as dA,BK as dB,ZG as dC,QG as dD,UI as dE,S3 as dF,YI as dG,DY as dH,zI as dI,cb as dJ,SK as dK,gK as dL,bK as dM,Ih as dN,ub as dO,iK as dP,db as dQ,zo as dR,HK as dS,tb as dT,eb as dU,KK as dV,sb as dW,vY as dX,CK as dY,oK as dZ,sK as d_,za as da,J0 as db,IY as dc,ZK as dd,ob as de,VD as df,lb as dg,nL as dh,_2 as di,YK as dj,XK as dk,ab as dl,nY as dm,ym as dn,UY as dp,_D as dq,iY as dr,o2 as ds,JD as dt,BI as du,H$ as dv,ta as dw,eI as dx,od as dy,CY as dz,J_ as e,NG as e$,Dh as e0,qI as e1,RY as e2,fb as e3,oY as e4,Kp as e5,XN as e6,XG as e7,JG as e8,Xh as e9,l2 as eA,QD as eB,DI as eC,FD as eD,Ha as eE,y2 as eF,LG as eG,IG as eH,Pr as eI,Nw as eJ,b2 as eK,AN as eL,MN as eM,TN as eN,z$ as eO,lr as eP,Cb as eQ,DK as eR,C2 as eS,MI as eT,NI as eU,TI as eV,kI as eW,EI as eX,ld as eY,AI as eZ,DG as e_,QI as ea,bY as eb,AD as ec,jK as ed,UK as ee,zK as ef,nb as eg,ru as eh,bm as ei,Pp as ej,l0 as ek,Ny as el,TK as em,AK as en,eK as eo,wc as ep,Es as eq,SD as er,pb as es,rK as et,nK as eu,Rl as ev,JI as ew,El as ex,kY as ey,cr as ez,BR as f,pu as f$,tK as f0,WG as f1,K0 as f2,GG as f3,$G as f4,aK as f5,Wp as f6,Cn as f7,aY as f8,_m as f9,gb as fA,vD as fB,wI as fC,tu as fD,yb as fE,jY as fF,Xs as fG,ib as fH,TY as fI,CD as fJ,Sl as fK,Xi as fL,xs as fM,wY as fN,x2 as fO,h2 as fP,WI as fQ,AY as fR,xD as fS,i2 as fT,xK as fU,jp as fV,_K as fW,uY as fX,wK as fY,yK as fZ,vK as f_,u0 as fa,zY as fb,GI as fc,MY as fd,jD as fe,a2 as ff,NY as fg,Ml as fh,fY as fi,Sn as fj,aL as fk,c2 as fl,u2 as fm,Ir as fn,vm as fo,PI as fp,UG as fq,HG as fr,zG as fs,qG as ft,ad as fu,xY as fv,ZI as fw,QE as fx,yY as fy,YG as fz,id as g,lX as g$,P$ as g0,_b as g1,sY as g2,HY as g3,SY as g4,kK as g5,bb as g6,vb as g7,Or as g8,jG as g9,am as gA,YY as gB,nX as gC,Lo as gD,XY as gE,ZY as gF,qY as gG,KY as gH,GY as gI,RW as gJ,MW as gK,WY as gL,Gt as gM,Ep as gN,$Y as gO,sX as gP,rX as gQ,iX as gR,QY as gS,aX as gT,kO as gU,ja as gV,JW as gW,Gs as gX,eX as gY,oX as gZ,tX as g_,FG as ga,PG as gb,xb as gc,$0 as gd,PK as ge,FK as gf,w2 as gg,_Y as gh,$p as gi,GK as gj,UD as gk,LK as gl,IK as gm,Kh as gn,SI as go,Fp as gp,Zc as gq,Jc as gr,KG as gs,OK as gt,RK as gu,hO as gv,Oh as gw,WT as gx,cX as gy,t$ as gz,Z_ as h,JY as h0,n$ as h1,s$ as h2,KW as h3,hm as i,A as j,FE as k,JR as l,UR as m,_s as n,rr as o,$R as p,w$ as q,V as r,S$ as s,zR as t,C$ as u,bs as v,yn as w,Nt as x,gt as y,x$ as z};